]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Move __has_builtin() fallback define to compiler.h
authorNick Terrell <terrelln@fb.com>
Thu, 24 Sep 2020 22:45:08 +0000 (15:45 -0700)
committerNick Terrell <terrelln@fb.com>
Thu, 24 Sep 2020 22:51:08 +0000 (15:51 -0700)
lib/common/compiler.h
lib/common/mem.h

index 321368ae7a5ae10f9d37d2073ce0228f2c153b50..060d00976b2a44d7fdca5d7534059e896a5a2fef 100644 (file)
     #define STATIC_BMI2 0
 #endif
 
+/* compat. with non-clang compilers */
+#ifndef __has_builtin
+#  define __has_builtin(x) 0
+#endif
+
 /* detects whether we are being compiled under msan */
 #if defined (__has_feature)
 #  if __has_feature(memory_sanitizer)
index b60f0eb97c0a10ca3766fbb8cba708ff09bb5b42..a94dd62b593c673d150f797338ee48882a30280d 100644 (file)
@@ -39,10 +39,6 @@ extern "C" {
 #  define MEM_STATIC static  /* this version may generate warnings for unused static functions; disable the relevant warning */
 #endif
 
-#ifndef __has_builtin
-#  define __has_builtin(x) 0  /* compat. with non-clang compilers */
-#endif
-
 /* code only tested on 32 and 64 bits systems */
 MEM_STATIC void MEM_check(void) { DEBUG_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); }