summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2022-11-21 09:50:20 (GMT)
committerGitHub <noreply@github.com>2022-11-21 09:50:20 (GMT)
commitcdde29dde90947df9bac39c1d19479914fb3db09 (patch)
treebed26cebb9afdf979bf632b27f3088742554521a /Python
parent6d8da238ccdf946dc90e20821652d8caa25b76ba (diff)
downloadcpython-cdde29dde90947df9bac39c1d19479914fb3db09.zip
cpython-cdde29dde90947df9bac39c1d19479914fb3db09.tar.gz
cpython-cdde29dde90947df9bac39c1d19479914fb3db09.tar.bz2
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
Diffstat (limited to 'Python')
-rw-r--r--Python/pylifecycle.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 10636b4..8209132 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -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")))