Skip to content

Commit

Permalink
bpo-42692: fix __builtin_available check on older compilers (GH-23873) (
Browse files Browse the repository at this point in the history
GH-24090)

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
(cherry picked from commit df21f50)

Co-authored-by: Joshua Root <jmr@macports.org>
  • Loading branch information
miss-islington and jmroot committed Jan 4, 2021
1 parent 76489dd commit eedeaef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
@@ -0,0 +1 @@
Fix __builtin_available check on older compilers. Patch by Joshua Root.
8 changes: 7 additions & 1 deletion Modules/posixmodule.c
Expand Up @@ -56,7 +56,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, *)
Expand Down

0 comments on commit eedeaef

Please sign in to comment.