mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.11] gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470) (#99638)
gh-99337: Fix compile errors with gcc 12 on macOS (GH-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
(cherry picked from commit cdde29dde9
)
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
This commit is contained in:
parent
f381644819
commit
aa067868ec
7 changed files with 54 additions and 9 deletions
|
@ -82,6 +82,10 @@ int _Py_UnhandledKeyboardInterrupt = 0;
|
|||
* 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")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue