From 9cbdf97511324baeca3e338cf5c3273cbd8ca4f4 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Feb 2015 13:55:58 +0100 Subject: [PATCH 1/3] Compile fixes for Apple GCC 4.2 --- include/bx/macros.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/include/bx/macros.h b/include/bx/macros.h index 131aa29..d2a9826 100644 --- a/include/bx/macros.h +++ b/include/bx/macros.h @@ -61,7 +61,11 @@ # if BX_COMPILER_CLANG && (BX_PLATFORM_OSX || BX_PLATFORM_IOS) # define BX_THREAD /* not supported right now */ # else -# define BX_THREAD __thread +# if (__GNUC__ == 4) && (__GNUC_MINOR__ <= 2) +# define BX_THREAD /* not supported right now */ +# else +# define BX_THREAD __thread +# endif // __GNUC__ <= 4.2 # endif // BX_COMPILER_CLANG # define BX_ATTRIBUTE(_x) __attribute__( (_x) ) # if BX_COMPILER_MSVC_COMPATIBLE @@ -134,7 +138,7 @@ # define BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG(_x) #endif // BX_COMPILER_CLANG -#if BX_COMPILER_GCC +#if BX_COMPILER_GCC && (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6) # define BX_PRAGMA_DIAGNOSTIC_PUSH_GCC() _Pragma("GCC diagnostic push") # define BX_PRAGMA_DIAGNOSTIC_POP_GCC() _Pragma("GCC diagnostic pop") # define BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC(_x) _Pragma(BX_STRINGIZE(GCC diagnostic ignored _x) ) @@ -169,8 +173,13 @@ #endif // BX_COMPILER_ /// -#define BX_TYPE_IS_POD(_type) (!__is_class(_type) || __is_pod(_type) ) - +#if defined(__GNUC__) && defined(__is_pod) +# define BX_TYPE_IS_POD(t) __is_pod(t) +#elif defined(_MSC_VER) +# define BX_TYPE_IS_POD(t) (!__is_class(t) || __is_pod(t)) +#else +# define BX_TYPE_IS_POD(t) false +#endif /// #define BX_CLASS_NO_DEFAULT_CTOR(_class) \ private: _class() From 30b6f8f869a38bd51c5d1bc177a51b5835e8bf06 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Feb 2015 18:59:21 +0100 Subject: [PATCH 2/3] Compile fixes for Apple GCC 4.2 --- include/bx/macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/bx/macros.h b/include/bx/macros.h index d2a9826..1c88556 100644 --- a/include/bx/macros.h +++ b/include/bx/macros.h @@ -138,7 +138,7 @@ # define BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG(_x) #endif // BX_COMPILER_CLANG -#if BX_COMPILER_GCC && (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6) +#if BX_COMPILER_GCC && BX_COMPILER_GCC >= 40600 # define BX_PRAGMA_DIAGNOSTIC_PUSH_GCC() _Pragma("GCC diagnostic push") # define BX_PRAGMA_DIAGNOSTIC_POP_GCC() _Pragma("GCC diagnostic pop") # define BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC(_x) _Pragma(BX_STRINGIZE(GCC diagnostic ignored _x) ) From 55fc17212934727e00ca340ccf01463a6041f10d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Feb 2015 19:19:06 +0100 Subject: [PATCH 3/3] forgot this one --- include/bx/macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/bx/macros.h b/include/bx/macros.h index 1c88556..b50cfc5 100644 --- a/include/bx/macros.h +++ b/include/bx/macros.h @@ -173,9 +173,9 @@ #endif // BX_COMPILER_ /// -#if defined(__GNUC__) && defined(__is_pod) +#if BX_COMPILER_GCC && defined(__is_pod) # define BX_TYPE_IS_POD(t) __is_pod(t) -#elif defined(_MSC_VER) +#elif BX_COMPILER_MSVC # define BX_TYPE_IS_POD(t) (!__is_class(t) || __is_pod(t)) #else # define BX_TYPE_IS_POD(t) false