diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2023-01-18 19:58:33 +0000 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2023-01-21 17:07:07 +0000 |
commit | 442d2bdc1d2a98aba0b18aeaa3e87fa946ac8031 (patch) | |
tree | f045facec7510be57c1a9a1c59a108588426eb1d /fixincludes/inclhack.def | |
parent | 1bdb1768bf7d83ae87ba7c12bd9566830a1ac772 (diff) | |
download | gcc-442d2bdc1d2a98aba0b18aeaa3e87fa946ac8031.zip gcc-442d2bdc1d2a98aba0b18aeaa3e87fa946ac8031.tar.gz gcc-442d2bdc1d2a98aba0b18aeaa3e87fa946ac8031.tar.bz2 |
Darwin, fixincludes: Handle MacOS13 SDK Apple-specific deprecations [PR107568].
The SDK for MacOS13 includes Apple-specific deprecations of some functions that
are not deprecated in Posix, C or C++ and widely used in GCC.
The fix makes the deprecation conditional on __APPLE_LOCAL_DEPRECATIONS so that
end users may still observe them but they are hidden from normal compilations.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR target/107568
fixincludes/ChangeLog:
* fixincl.x: Regenerate.
* inclhack.def: Add a fix for MacOS13 SDK function deprecations
in stdio.h.
* tests/base/stdio.h (__deprecated_msg): New test.
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r-- | fixincludes/inclhack.def | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index d463747..ea879b7 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -1269,6 +1269,18 @@ fix = { test_text = '#define vfscanf __svfscanf'; }; +fix = { + hackname = apple_local_stdio_fn_deprecation; + mach = "*-*-*darwin2*"; + files = stdio.h; + select = "__deprecated_msg([^\n]*)$"; + c_fix = format; + c_fix_arg = "#if defined(__APPLE_LOCAL_DEPRECATIONS)\n" + "%0\n" + "#endif"; + test_text = '__deprecated_msg("This function is provided for compat...")'; +}; + /* * Fix various macros used to define ioctl numbers. * The traditional syntax was: |