From: Nick Terrell Date: Thu, 24 Sep 2020 22:45:08 +0000 (-0700) Subject: Move __has_builtin() fallback define to compiler.h X-Git-Tag: v1.4.7~69^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=260fc7502877ae4d4114c33053e1926c4b857600;p=thirdparty%2Fzstd.git Move __has_builtin() fallback define to compiler.h --- diff --git a/lib/common/compiler.h b/lib/common/compiler.h index 321368ae7..060d00976 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -196,6 +196,11 @@ #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) diff --git a/lib/common/mem.h b/lib/common/mem.h index b60f0eb97..a94dd62b5 100644 --- a/lib/common/mem.h +++ b/lib/common/mem.h @@ -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)); }