From 1622408b3f61fc4a80df66994a0c8e9b88558331 Mon Sep 17 00:00:00 2001 From: Joshua Root Date: Mon, 21 Dec 2020 05:22:21 +1100 Subject: [PATCH 1/2] bpo-42692: fix __builtin_available check on older compilers A compiler that doesn't define __has_builtin will error out when it is used on the same line as the check for it. --- Modules/posixmodule.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d9eb62f20e65bd..7635209e12ee4b 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, *) From 400ba6d54494b0f414e5940a920a2ee5126b2813 Mon Sep 17 00:00:00 2001 From: Ned Deily Date: Mon, 4 Jan 2021 05:13:01 -0500 Subject: [PATCH 2/2] add NEWS blurb --- Misc/NEWS.d/next/Build/2021-01-04-05-07-30.bpo-42692.OO11SN.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Build/2021-01-04-05-07-30.bpo-42692.OO11SN.rst diff --git a/Misc/NEWS.d/next/Build/2021-01-04-05-07-30.bpo-42692.OO11SN.rst b/Misc/NEWS.d/next/Build/2021-01-04-05-07-30.bpo-42692.OO11SN.rst new file mode 100644 index 00000000000000..91582b945b803f --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-01-04-05-07-30.bpo-42692.OO11SN.rst @@ -0,0 +1 @@ +Fix __builtin_available check on older compilers. Patch by Joshua Root.