Skip to content

Commit 9148985

Browse files
committed
fixed source location include header error
1 parent 1d1eccb commit 9148985

1 file changed

Lines changed: 2 additions & 64 deletions

File tree

src/vmaware.hpp

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -219,32 +219,23 @@
219219

220220
#ifndef __VMAWARE_DEBUG__
221221
#if defined(_DEBUG) /* MSVC Debug */ \
222-
|| defined(DEBUG) /* user or build-system */
223-
#define __VMAWARE_DEBUG__
224-
#if defined(_DEBUG) /* MSVC Debug */ \
225222
|| defined(DEBUG) /* user or build-system */
226223
#define __VMAWARE_DEBUG__
227224
#endif
228225
#endif
229-
#endif
230226

231-
#if defined(_WIN32) || defined(_WIN64)
232227
#if defined(_WIN32) || defined(_WIN64)
233228
#ifndef WIN32_LEAN_AND_MEAN
234229
#define WIN32_LEAN_AND_MEAN
235-
#define WIN32_LEAN_AND_MEAN
236230
#endif
237231

238-
239232
#define WINDOWS 1
240233
#define LINUX 0
241234
#define APPLE 0
242-
#elif (defined(__linux__))
243235
#elif (defined(__linux__))
244236
#define WINDOWS 0
245237
#define LINUX 1
246238
#define APPLE 0
247-
#elif (defined(__APPLE__) || defined(__APPLE_CPP__) || defined(__MACH__) || defined(__DARWIN))
248239
#elif (defined(__APPLE__) || defined(__APPLE_CPP__) || defined(__MACH__) || defined(__DARWIN))
249240
#define WINDOWS 0
250241
#define LINUX 0
@@ -257,96 +248,68 @@
257248

258249
#ifdef _MSC_VER
259250
#define MSVC 1
260-
#define MSVC 1
261251
#endif
262252

263253
#if defined(_MSVC_LANG)
264254
#define VMA_CPLUSPLUS _MSVC_LANG
265-
#else
266255
#else
267256
#define VMA_CPLUSPLUS __cplusplus
268257
#endif
269-
#endif
270258

271259
#if VMA_CPLUSPLUS >= 202302L
272260
#define VMA_CPP 23
273261
#elif VMA_CPLUSPLUS >= 202002L
274262
#define VMA_CPP 20
275-
#define VMA_CPP 20
276263
#elif VMA_CPLUSPLUS >= 201703L
277264
#define VMA_CPP 17
278-
#define VMA_CPP 17
279265
#elif VMA_CPLUSPLUS >= 201402L
280266
#define VMA_CPP 14
281-
#define VMA_CPP 14
282267
#elif VMA_CPLUSPLUS >= 201103L
283268
#define VMA_CPP 11
284-
#define VMA_CPP 11
285269
#elif VMA_CPLUSPLUS >= 199711L
286270
#define VMA_CPP 98 /* C++98 or C++03 */
287-
#define VMA_CPP 98 /* C++98 or C++03 */
288271
#else
289272
#error "Unsupported C++ standard (pre-C++98 or unknown)."
290273
#endif
291-
#endif
292274

293275
#if (VMA_CPP < 11 && !WINDOWS)
294276
#error "VMAware only supports C++11 or above, set your compiler flag to '-std=c++20' for gcc/clang, or '/std:c++20' for MSVC"
295277
#endif
296278

297-
#if defined(__x86_64__) || defined(_M_X64)
298-
#endif
299-
300279
#if defined(__x86_64__) || defined(_M_X64)
301280
#define x86_64 1
302-
#else
303281
#else
304282
#define x86_64 0
305283
#endif
306284

307285
#if defined(__i386__) || defined(_M_IX86)
308286
#define x86_32 1
309-
#else
310287
#else
311288
#define x86_32 0
312289
#endif
313290

314291
#if x86_32 || x86_64
315292
#define x86 1
316-
#define x86 1
317293
#else
318294
#define x86 0
319295
#endif
320-
#endif
321296

322297
#if defined(__aarch64__) || defined(_M_ARM64) || defined(__ARM_LINUX_COMPILER__)
323298
#define ARM64 1
324-
#define ARM64 1
325299
#else
326300
#define ARM64 0
327301
#endif
328-
#endif
329302

330303
#if (defined(__arm__) || defined(_M_ARM)) && !ARM64
331304
#define ARM32 1
332-
#else
333305
#else
334306
#define ARM32 0
335307
#endif
336-
#endif
337308

338-
#if ARM32 || ARM64
339309
#if ARM32 || ARM64
340310
#define ARM 1
341311
#else
342312
#define ARM 0
343-
#define ARM 0
344-
#endif
345-
346-
#if (!APPLE && (VMA_CPP >= 20) && (!CLANG || __clang_major__ >= 16))
347-
#define SOURCE_LOCATION_SUPPORTED 1
348-
#else
349-
#define SOURCE_LOCATION_SUPPORTED 0
350313
#endif
351314

352315
#if (!APPLE && (VMA_CPP >= 20) && (!CLANG || __clang_major__ >= 16))
@@ -358,28 +321,20 @@
358321
#if defined(__clang__)
359322
#define GCC 0
360323
#define CLANG 1
361-
#define GCC 0
362-
#define CLANG 1
363324
#elif defined(__GNUC__)
364325
#define GCC 1
365326
#define CLANG 0
366-
#define GCC 1
367-
#define CLANG 0
368327
#else
369328
#define GCC 0
370329
#define CLANG 0
371-
#define GCC 0
372-
#define CLANG 0
373330
#endif
374331

375332
#if !(defined(WINDOWS) || defined(LINUX) || defined(APPLE))
376333
#warning "Unknown OS detected, tests will be severely limited"
377-
#warning "Unknown OS detected, tests will be severely limited"
378334
#endif
379335

380336
#if (VMA_CPP >= 23)
381337
#include <limits>
382-
#include <limits>
383338
#endif
384339
#if (VMA_CPP >= 20)
385340
#include <bit>
@@ -390,10 +345,9 @@
390345
#endif
391346
#if (VMA_CPP >= 17)
392347
#include <filesystem>
393-
#include <system_error>
394-
#endif
348+
#include <system_error>
349+
#endif
395350
#ifdef __VMAWARE_DEBUG__
396-
#include <iomanip>
397351
#include <iomanip>
398352
#include <ios>
399353
#include <locale>
@@ -431,20 +385,7 @@
431385
#include <devpkey.h>
432386
#include <devguid.h>
433387
#include <winevt.h>
434-
#include <windows.h>
435-
#include <intrin.h>
436-
#include <winioctl.h>
437-
#include <winternl.h>
438-
#include <powerbase.h>
439-
#include <setupapi.h>
440-
#include <initguid.h>
441-
#include <devpkey.h>
442-
#include <devguid.h>
443-
#include <winevt.h>
444388

445-
#pragma comment(lib, "setupapi.lib")
446-
#pragma comment(lib, "powrprof.lib")
447-
#pragma comment(lib, "mincore.lib")
448389
#pragma comment(lib, "setupapi.lib")
449390
#pragma comment(lib, "powrprof.lib")
450391
#pragma comment(lib, "mincore.lib")
@@ -11171,7 +11112,6 @@ struct VM {
1117111112
*/
1117211113
static bool check(
1117311114
const enum_flags flag_bit
11174-
#if (SOURCE_LOCATION_SUPPORTED)
1117511115
#if (SOURCE_LOCATION_SUPPORTED)
1117611116
, [[maybe_unused]] const std::source_location& loc = std::source_location::current()
1117711117
#endif
@@ -11571,7 +11511,6 @@ struct VM {
1157111511
const u8 percent,
1157211512
bool(*detection_func)()
1157311513
#if (SOURCE_LOCATION_SUPPORTED)
11574-
#if (SOURCE_LOCATION_SUPPORTED)
1157511514
, const std::source_location& loc = std::source_location::current()
1157611515
#endif
1157711516
) {
@@ -11769,7 +11708,6 @@ struct VM {
1176911708
static void modify_score(
1177011709
const enum_flags flag,
1177111710
const u8 percent
11772-
#if (SOURCE_LOCATION_SUPPORTED)
1177311711
#if (SOURCE_LOCATION_SUPPORTED)
1177411712
, const std::source_location& loc = std::source_location::current()
1177511713
#endif

0 commit comments

Comments
 (0)