diff --git a/configure.ac b/configure.ac index 5d62d0d7..479dc64f 100644 --- a/configure.ac +++ b/configure.ac @@ -635,7 +635,7 @@ AC_SUBST(HAVE_AVX_ASM_V) AC_MSG_CHECKING(for 128-bit arithmetic) HAVE_TI_MODE_V=0 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#if !defined(__GNUC__) && !defined(__SIZEOF_INT128__) +#if !defined(__clang__) && !defined(__GNUC__) && !defined(__SIZEOF_INT128__) # error mode(TI) is a gcc extension, and __int128 is not available #endif #if defined(__clang__) && !defined(__x86_64__) && !defined(__ARM_NEON) diff --git a/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h b/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h index bcf447cd..cef64480 100644 --- a/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +++ b/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h @@ -5,7 +5,7 @@ #if defined(_MSC_VER) # define POLY1305_NOINLINE __declspec(noinline) -#elif defined(__GNUC__) +#elif defined(__clang__) || defined(__GNUC__) # define POLY1305_NOINLINE __attribute__((noinline)) #else # define POLY1305_NOINLINE diff --git a/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h b/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h index e0ed7547..c827f898 100644 --- a/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +++ b/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h @@ -13,7 +13,7 @@ #if defined(_MSC_VER) # define POLY1305_NOINLINE __declspec(noinline) -#elif defined(__GNUC__) +#elif defined(__clang__) || defined(__GNUC__) # define POLY1305_NOINLINE __attribute__((noinline)) #else # define POLY1305_NOINLINE diff --git a/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c b/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c index 022f1524..e80c961d 100644 --- a/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +++ b/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c @@ -21,7 +21,7 @@ typedef __m128i xmmi; # if defined(_MSC_VER) # define POLY1305_NOINLINE __declspec(noinline) -# elif defined(__GNUC__) +# elif defined(__clang__) || defined(__GNUC__) # define POLY1305_NOINLINE __attribute__((noinline)) # else # define POLY1305_NOINLINE diff --git a/src/libsodium/include/sodium/export.h b/src/libsodium/include/sodium/export.h index 0f624ae3..b786c77b 100644 --- a/src/libsodium/include/sodium/export.h +++ b/src/libsodium/include/sodium/export.h @@ -2,7 +2,7 @@ #ifndef sodium_export_H #define sodium_export_H -#ifndef __GNUC__ +#if !defined(__clang__) && !defined(__GNUC__) # ifdef __attribute__ # undef __attribute__ # endif diff --git a/src/libsodium/include/sodium/private/common.h b/src/libsodium/include/sodium/private/common.h index 954d02cc..632fc8a7 100644 --- a/src/libsodium/include/sodium/private/common.h +++ b/src/libsodium/include/sodium/private/common.h @@ -196,7 +196,7 @@ xor_buf(unsigned char *out, const unsigned char *in, size_t n) } } -#ifndef __GNUC__ +#if !defined(__clang__) && !defined(__GNUC__) # ifdef __attribute__ # undef __attribute__ # endif diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index b9a85944..a176f87a 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -25,7 +25,7 @@ # ifdef HAVE_ALLOCA_H # include # elif !defined(alloca) -# if defined(__GNUC__) +# if defined(__clang__) || defined(__GNUC__) # define alloca __builtin_alloca # elif defined _AIX # define alloca __alloca