From be3840d8c79cb002c1c24fc01e2b2794a963d8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Tue, 15 Aug 2023 16:35:59 +0200 Subject: [PATCH] fix build with Apple clang 4.2 on Mac OS X Lion --- xxh_x86dispatch.c | 6 +++++- xxhash.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xxh_x86dispatch.c b/xxh_x86dispatch.c index 2489e153..5f8a4a01 100644 --- a/xxh_x86dispatch.c +++ b/xxh_x86dispatch.c @@ -59,7 +59,11 @@ extern "C" { /*! @cond Doxygen ignores this part */ #ifndef XXH_HAS_INCLUDE # ifdef __has_include -# define XXH_HAS_INCLUDE(x) __has_include(x) +/* + * Not defined as XXH_HAS_INCLUDE(x) (function-like) because + * this causes segfaults in Apple Clang 4.2 (on Mac OS X 10.7 Lion) + */ +# define XXH_HAS_INCLUDE __has_include # else # define XXH_HAS_INCLUDE(x) 0 # endif diff --git a/xxhash.h b/xxhash.h index 5e2c0ed2..44019a5f 100644 --- a/xxhash.h +++ b/xxhash.h @@ -3416,7 +3416,11 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_can #ifndef XXH_HAS_INCLUDE # ifdef __has_include -# define XXH_HAS_INCLUDE(x) __has_include(x) +/* + * Not defined as XXH_HAS_INCLUDE(x) (function-like) because + * this causes segfaults in Apple Clang 4.2 (on Mac OS X 10.7 Lion) + */ +# define XXH_HAS_INCLUDE __has_include # else # define XXH_HAS_INCLUDE(x) 0 # endif