Branimir Karadžić 11 лет назад
Родитель
Сommit
6b39d25a92
2 измененных файлов с 7 добавлено и 4 удалено
  1. 1 1
      include/bx/float4_t.h
  2. 6 3
      include/bx/macros.h

+ 1 - 1
include/bx/float4_t.h

@@ -15,7 +15,7 @@
 #	include "float4_sse.h"
 #elif defined(__ARM_NEON__) && !BX_COMPILER_CLANG
 #	include "float4_neon.h"
-#elif BX_COMPILER_CLANG && !BX_PLATFORM_EMSCRIPTEN && __has_extension(attribute_ext_vector_type)
+#elif BX_COMPILER_CLANG && !BX_PLATFORM_EMSCRIPTEN && BX_CLANG_HAS_EXTENSION(attribute_ext_vector_type)
 #	include "float4_langext.h"
 #else
 #	ifndef BX_FLOAT4_WARN_REFERENCE_IMPL

+ 6 - 3
include/bx/macros.h

@@ -67,9 +67,6 @@
 #	if BX_COMPILER_MSVC_COMPATIBLE
 #		define __stdcall
 #	endif // BX_COMPILER_MSVC_COMPATIBLE
-#	if BX_COMPILER_GCC && !defined(__has_extension)
-#		define __has_extension(x) false
-#	endif // BX_COMPILER_GCC && !defined(__has_extension)
 #elif BX_COMPILER_MSVC
 #	define BX_ALIGN_DECL(_align, _decl) __declspec(align(_align) ) _decl
 #	define BX_ALLOW_UNUSED
@@ -86,6 +83,12 @@
 #	error "Unknown BX_COMPILER_?"
 #endif
 
+#if defined(__has_extension)
+#	define BX_CLANG_HAS_EXTENSION(_x) __has_extension(_x)
+#else
+#	define BX_CLANG_HAS_EXTENSION(_x) 0
+#endif // defined(__has_extension)
+
 // #define BX_STATIC_ASSERT(_condition, ...) static_assert(_condition, "" __VA_ARGS__)
 #define BX_STATIC_ASSERT(_condition, ...) typedef char BX_CONCATENATE(BX_STATIC_ASSERT_, __LINE__)[1][(_condition)] BX_ATTRIBUTE(unused)