From 1cf22de13fb5d675dc93d1199a75e165a450c0c9 Mon Sep 17 00:00:00 2001 From: Leon Freist Date: Wed, 24 Jul 2024 15:48:06 +0200 Subject: [PATCH] fix linux build --- include/hwinfo/platform.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/include/hwinfo/platform.h b/include/hwinfo/platform.h index 406640d..89e5507 100644 --- a/include/hwinfo/platform.h +++ b/include/hwinfo/platform.h @@ -8,6 +8,18 @@ #endif #if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) #define HWINFO_WINDOWS +#endif + +#if defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || defined(_M_X64) +#define HWINFO_X86_64 +#elif defined(__i386__) || defined(_M_IX86) +#define HWINFO_X86_32 +#endif +#if defined(HWINFO_X86_64) || defined(HWINFO_X86_32) +#define HWINFO_X86 +#endif + +// dll exports/imports for windows shared libraries #ifdef _WIN32 #ifdef HWINFO_EXPORTS #define HWINFO_API __declspec(dllexport) @@ -21,16 +33,6 @@ #else #define HWINFO_API #endif -#endif - -#if defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || defined(_M_X64) -#define HWINFO_X86_64 -#elif defined(__i386__) || defined(_M_IX86) -#define HWINFO_X86_32 -#endif -#if defined(HWINFO_X86_64) || defined(HWINFO_X86_32) -#define HWINFO_X86 -#endif // macro definitions for C++ > 11 features if compiled with C++ > 11 #if __cplusplus >= 201703L