summaryrefslogtreecommitdiff
path: root/fixincludes/inclhack.def
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2023-01-18 19:58:33 +0000
committerIain Sandoe <iain@sandoe.co.uk>2023-01-21 17:07:07 +0000
commit442d2bdc1d2a98aba0b18aeaa3e87fa946ac8031 (patch)
treef045facec7510be57c1a9a1c59a108588426eb1d /fixincludes/inclhack.def
parent1bdb1768bf7d83ae87ba7c12bd9566830a1ac772 (diff)
downloadgcc-442d2bdc1d2a98aba0b18aeaa3e87fa946ac8031.tar.gz
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.def12
1 files changed, 12 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index d4637470d7a..ea879b73bad 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: