diff options
author | Joshua Root <jmr@macports.org> | 2021-01-04 10:36:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-04 10:36:58 (GMT) |
commit | df21f502fdccec234282bf0a211af979fd23def4 (patch) | |
tree | 60af144fe8a558722a779bc8ed4ef06ca0dab876 /Modules/posixmodule.c | |
parent | b6fc0c406e6b4b86f59b1390142f35da0e364927 (diff) | |
download | cpython-df21f502fdccec234282bf0a211af979fd23def4.zip cpython-df21f502fdccec234282bf0a211af979fd23def4.tar.gz cpython-df21f502fdccec234282bf0a211af979fd23def4.tar.bz2 |
bpo-42692: fix __builtin_available check on older compilers (GH-23873)
A compiler that doesn't define `__has_builtin` will error out when it is
used on the same line as the check for it.
Automerge-Triggered-By: GH:ronaldoussoren
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 13e3963..4468fd0 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -61,7 +61,13 @@ */ #if defined(__APPLE__) -#if defined(__has_builtin) && __has_builtin(__builtin_available) +#if defined(__has_builtin) +#if __has_builtin(__builtin_available) +#define HAVE_BUILTIN_AVAILABLE 1 +#endif +#endif + +#ifdef HAVE_BUILTIN_AVAILABLE # define HAVE_FSTATAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *) # define HAVE_FACCESSAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *) # define HAVE_FCHMODAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *) |