diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2019-06-21 19:03:45 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2019-06-21 19:03:45 +0000 |
commit | 59a0b1db756fc17b952c8423b015154a7bd23d10 (patch) | |
tree | 4abe4978c16869c56b5e3d6e26351c671ae980dc /fixincludes/inclhack.def | |
parent | 8d5558c518a8812276aee50cca3da8ca5cce3091 (diff) | |
download | gcc-59a0b1db756fc17b952c8423b015154a7bd23d10.zip gcc-59a0b1db756fc17b952c8423b015154a7bd23d10.tar.gz gcc-59a0b1db756fc17b952c8423b015154a7bd23d10.tar.bz2 |
[Darwin, fixincludes] Fix Darwin14 header issues.
There are two issues with the Darwin14 (SDK) headers in which unguarded
advanced syntax elements causes any code including these headers to fail.
2019-06-21 Iain Sandoe <iain@sandoe.co.uk>
* inclhack.def: Guard __has_attribute and __has_extension in
os/base.h.
Guard Apple blocks syntax in dispatch/object.h.
* fixincl.x: Regenerate.
* tests/base/dispatch/object.h: New file.
* tests/base/os/base.h: New file.
From-SVN: r272561
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r-- | fixincludes/inclhack.def | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 3900d15..727f7d2 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -1426,6 +1426,49 @@ fix = { }; /* + * In macOS 10.10 <os/base.h>, doesn't have __has_extension guarded. + */ +fix = { + hackname = darwin_os_base_1; + mach = "*-*-darwin*"; + files = os/base.h; + select = <<- OS_BASE_1_SEL +#define __has_attribute.* +#endif +OS_BASE_1_SEL; + c_fix = format; + c_fix_arg = <<- OS_BASE_1_FIX +%0 +#ifndef __has_extension +#define __has_extension(x) 0 +#endif +OS_BASE_1_FIX; + test_text = <<- OS_BASE_1_TEST +#define __has_attribute(x) 0 +#endif + +#if __GNUC__ +OS_BASE_1_TEST; +}; + +/* + * In macOS 10.10 <dispatch/object.h>, has unguarded block syntax. + */ +fix = { + hackname = darwin_dispatch_object_1; + mach = "*-*-darwin*"; + files = dispatch/object.h; + select = "typedef void.*\\^dispatch_block_t.*"; + c_fix = format; + c_fix_arg = "#if __BLOCKS__\n%0\n#endif"; + test_text = <<- DISPATCH_OBJECT_1_TEST +typedef void (^dispatch_block_t)(void); + +__BEGIN_DECLS +DISPATCH_OBJECT_1_TEST; +}; + +/* * __private_extern__ doesn't exist in FSF GCC. Even if it did, * why would you ever put it in a system header file? */ |