diff options
author | Victor Stinner <vstinner@python.org> | 2020-09-01 16:25:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-01 16:25:14 (GMT) |
commit | e6905e4c82cc05897dc1bf5ab2b5b94b2b043a7f (patch) | |
tree | 9db617818ea306e8979049178322281524385534 /Include/internal/pycore_bitutils.h | |
parent | 0d6aa7f0ee38eb453bc8f73bf4830e6172be2f35 (diff) | |
download | cpython-e6905e4c82cc05897dc1bf5ab2b5b94b2b043a7f.zip cpython-e6905e4c82cc05897dc1bf5ab2b5b94b2b043a7f.tar.gz cpython-e6905e4c82cc05897dc1bf5ab2b5b94b2b043a7f.tar.bz2 |
bpo-41617: Fix pycore_bitutils.h to support clang 3.0 (GH-22042)
__builtin_bswap16() is not available in LLVM clang 3.0.
Diffstat (limited to 'Include/internal/pycore_bitutils.h')
-rw-r--r-- | Include/internal/pycore_bitutils.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Include/internal/pycore_bitutils.h b/Include/internal/pycore_bitutils.h index 0bd3270..1602fc6 100644 --- a/Include/internal/pycore_bitutils.h +++ b/Include/internal/pycore_bitutils.h @@ -17,10 +17,12 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#if defined(__clang__) || \ - (defined(__GNUC__) && \ - ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 8))) - /* __builtin_bswap16() is available since GCC 4.8, +#if ((defined(__GNUC__) \ + && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 8))) \ + || (defined(__clang__) \ + && (__clang_major__ >= 4 \ + || (__clang_major__ == 3 && __clang_minor__ >= 2)))) + /* __builtin_bswap16() is available since GCC 4.8 and clang 3.2, __builtin_bswap32() is available since GCC 4.3, __builtin_bswap64() is available since GCC 4.3. */ # define _PY_HAVE_BUILTIN_BSWAP |