Przeglądaj źródła

Fixed BX_TYPE_IS_POD macro.

Branimir Karadžić 9 lat temu
rodzic
commit
fed91842fe
1 zmienionych plików z 3 dodań i 4 usunięć
  1. 3 4
      include/bx/macros.h

+ 3 - 4
include/bx/macros.h

@@ -7,6 +7,7 @@
 #define BX_MACROS_H_HEADER_GUARD
 #define BX_MACROS_H_HEADER_GUARD
 
 
 #include "bx.h"
 #include "bx.h"
+#include <type_traits>
 
 
 ///
 ///
 #if BX_COMPILER_MSVC
 #if BX_COMPILER_MSVC
@@ -180,12 +181,10 @@
 #endif // BX_COMPILER_
 #endif // BX_COMPILER_
 
 
 ///
 ///
-#if BX_COMPILER_GCC && defined(__is_pod)
-#	define BX_TYPE_IS_POD(t) __is_pod(t)
-#elif BX_COMPILER_MSVC
+#if BX_COMPILER_MSVC
 #	define BX_TYPE_IS_POD(t) (!__is_class(t) || __is_pod(t))
 #	define BX_TYPE_IS_POD(t) (!__is_class(t) || __is_pod(t))
 #else
 #else
-#	define BX_TYPE_IS_POD(t) false
+#	define BX_TYPE_IS_POD(t) std::is_pod<t>::value
 #endif
 #endif
 ///
 ///
 #define BX_CLASS_NO_DEFAULT_CTOR(_class) \
 #define BX_CLASS_NO_DEFAULT_CTOR(_class) \