[libc] Only use __has_builtin on clang

The preprocessor reads the whole line even if the first condition of an and is false so this broke when compiling on older gcc versions which don't recognize `__has_builtin`
This commit is contained in:
Alex Brachet 2020-03-28 12:28:43 -04:00
parent 81f173ed0e
commit 6a4f8423ae

View File

@ -14,8 +14,10 @@
// __builtin_memcpy_inline guarantees to never call external functions.
// Unfortunately it is not widely available.
#if defined(__clang__) && __has_builtin(__builtin_memcpy_inline)
#ifdef __clang__
#if __has_builtin(__builtin_memcpy_inline)
#define USE_BUILTIN_MEMCPY_INLINE
#endif
#elif defined(__GNUC__)
#define USE_BUILTIN_MEMCPY
#endif