gh-99337: Fix compile errors with gcc 12 on macOS (#99470)

Fix a number of compile errors with GCC-12 on macOS:

1. In pylifecycle.c the compile rejects _Pragma within a declaration
2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
3. _ctypes assumed that __builtin_available is always present on macOS
This commit is contained in:
Ronald Oussoren 2022-11-21 10:50:20 +01:00 committed by GitHub
parent 6d8da238cc
commit cdde29dde9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 9 deletions

View file

@ -82,6 +82,10 @@ static void call_ll_exitfuncs(_PyRuntimeState *runtime);
* interpreter state for various runtime debugging tools, but is *not* an
* officially supported feature */
/* Suppress deprecation warning for PyBytesObject.ob_shash */
_Py_COMP_DIAG_PUSH
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
#if defined(MS_WINDOWS)
#pragma section("PyRuntime", read, write)
@ -95,9 +99,6 @@ __attribute__((
#endif
/* Suppress deprecation warning for PyBytesObject.ob_shash */
_Py_COMP_DIAG_PUSH
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
_PyRuntimeState _PyRuntime
#if defined(__linux__) && (defined(__GNUC__) || defined(__clang__))
__attribute__ ((section (".PyRuntime")))