mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-23 02:00:32 +08:00
[Darwin, fixincludes] Backport fix for PR83531
There is no reasonable chance that the SDKs in question will be re- issued, so the only viable solution is a fixincludes. 2019-09-04 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-08-18 C.G. Dogan <gcc+cgdogan.00@gmail.com> Iain Sandoe <iain@sandoe.co.uk> PR target/83531 * inclhack.def (darwin_api_availability): New; strip leading underscores from API_XXXX defines. * fixincl.x: Regenerate. * tests/base/os/availability.h: New file. From-SVN: r275381
This commit is contained in:
parent
318c48d7d7
commit
32426744fe
@ -1,3 +1,15 @@
|
||||
2019-09-04 Iain Sandoe <iain@sandoe.co.uk>
|
||||
|
||||
Backport from mainline.
|
||||
2019-08-18 C.G. Dogan <gcc+cgdogan.00@gmail.com>
|
||||
Iain Sandoe <iain@sandoe.co.uk>
|
||||
|
||||
PR target/83531
|
||||
* inclhack.def (darwin_api_availability): New; strip leading
|
||||
underscores from API_XXXX defines.
|
||||
* fixincl.x: Regenerate.
|
||||
* tests/base/os/availability.h: New file.
|
||||
|
||||
2019-09-04 Iain Sandoe <iain@sandoe.co.uk>
|
||||
|
||||
Backport from mainline.
|
||||
|
@ -2,11 +2,11 @@
|
||||
*
|
||||
* DO NOT EDIT THIS FILE (fixincl.x)
|
||||
*
|
||||
* It has been AutoGen-ed August 29, 2019 at 12:22:26 AM by AutoGen 5.17.4
|
||||
* It has been AutoGen-ed August 29, 2019 at 12:25:44 AM by AutoGen 5.17.4
|
||||
* From the definitions inclhack.def
|
||||
* and the template file fixincl
|
||||
*/
|
||||
/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Aug 29 00:22:26 BST 2019
|
||||
/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Aug 29 00:25:44 BST 2019
|
||||
*
|
||||
* You must regenerate it. Use the ./genfixes script.
|
||||
*
|
||||
@ -15,7 +15,7 @@
|
||||
* certain ANSI-incompatible system header files which are fixed to work
|
||||
* correctly with ANSI C and placed in a directory that GNU C will search.
|
||||
*
|
||||
* This file contains 252 fixup descriptions.
|
||||
* This file contains 253 fixup descriptions.
|
||||
*
|
||||
* See README for more information.
|
||||
*
|
||||
@ -267,6 +267,56 @@ static const char* apzAab_Darwin7_9_Long_Double_FuncsPatch[] = {
|
||||
#endif /* __MATH__ */",
|
||||
(char*)NULL };
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* Description of Darwin_Api_Availability fix
|
||||
*/
|
||||
tSCC zDarwin_Api_AvailabilityName[] =
|
||||
"darwin_api_availability";
|
||||
|
||||
/*
|
||||
* File name selection pattern
|
||||
*/
|
||||
tSCC zDarwin_Api_AvailabilityList[] =
|
||||
"os/availability.h\0";
|
||||
/*
|
||||
* Machine/OS name selection pattern
|
||||
*/
|
||||
tSCC* apzDarwin_Api_AvailabilityMachs[] = {
|
||||
"*-*-darwin*",
|
||||
(const char*)NULL };
|
||||
|
||||
/*
|
||||
* content selection pattern - do fix if pattern found
|
||||
*/
|
||||
tSCC zDarwin_Api_AvailabilitySelect0[] =
|
||||
" *#define __API_AVAILABLE.*\n\
|
||||
*#define __API_DEPRECATED.*\n\
|
||||
*#define __API_DEPRECATED_WITH_REPLACEMENT.*\n\
|
||||
*#define __API_UNAVAILABLE.*\n";
|
||||
|
||||
/*
|
||||
* content bypass pattern - skip fix if pattern found
|
||||
*/
|
||||
tSCC zDarwin_Api_AvailabilityBypass0[] =
|
||||
"__IPHONE_OS_VERSION_MIN_REQUIRED";
|
||||
|
||||
#define DARWIN_API_AVAILABILITY_TEST_CT 2
|
||||
static tTestDesc aDarwin_Api_AvailabilityTests[] = {
|
||||
{ TT_NEGREP, zDarwin_Api_AvailabilityBypass0, (regex_t*)NULL },
|
||||
{ TT_EGREP, zDarwin_Api_AvailabilitySelect0, (regex_t*)NULL }, };
|
||||
|
||||
/*
|
||||
* Fix Command Arguments for Darwin_Api_Availability
|
||||
*/
|
||||
static const char* apzDarwin_Api_AvailabilityPatch[] = {
|
||||
"format",
|
||||
" #define API_AVAILABLE(...)\n\
|
||||
#define API_DEPRECATED(...)\n\
|
||||
#define API_DEPRECATED_WITH_REPLACEMENT(...)\n\
|
||||
#define API_UNAVAILABLE(...)\n",
|
||||
(char*)NULL };
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* Description of Aab_Fd_Zero_Asm_Posix_Types_H fix
|
||||
@ -10297,9 +10347,9 @@ static const char* apzX11_SprintfPatch[] = {
|
||||
*
|
||||
* List of all fixes
|
||||
*/
|
||||
#define REGEX_COUNT 289
|
||||
#define REGEX_COUNT 291
|
||||
#define MACH_LIST_SIZE_LIMIT 187
|
||||
#define FIX_COUNT 252
|
||||
#define FIX_COUNT 253
|
||||
|
||||
/*
|
||||
* Enumerate the fixes
|
||||
@ -10308,6 +10358,7 @@ typedef enum {
|
||||
AAB_AIX_STDIO_FIXIDX,
|
||||
AAB_AIX_FCNTL_FIXIDX,
|
||||
AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_FIXIDX,
|
||||
DARWIN_API_AVAILABILITY_FIXIDX,
|
||||
AAB_FD_ZERO_ASM_POSIX_TYPES_H_FIXIDX,
|
||||
AAB_FD_ZERO_GNU_TYPES_H_FIXIDX,
|
||||
AAB_FD_ZERO_SELECTBITS_H_FIXIDX,
|
||||
@ -10575,6 +10626,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
|
||||
AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
|
||||
aAab_Darwin7_9_Long_Double_FuncsTests, apzAab_Darwin7_9_Long_Double_FuncsPatch, 0 },
|
||||
|
||||
{ zDarwin_Api_AvailabilityName, zDarwin_Api_AvailabilityList,
|
||||
apzDarwin_Api_AvailabilityMachs,
|
||||
DARWIN_API_AVAILABILITY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
|
||||
aDarwin_Api_AvailabilityTests, apzDarwin_Api_AvailabilityPatch, 0 },
|
||||
|
||||
{ zAab_Fd_Zero_Asm_Posix_Types_HName, zAab_Fd_Zero_Asm_Posix_Types_HList,
|
||||
apzAab_Fd_Zero_Asm_Posix_Types_HMachs,
|
||||
AAB_FD_ZERO_ASM_POSIX_TYPES_H_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
|
||||
|
@ -194,6 +194,33 @@ fix = {
|
||||
_EndOfHeader_;
|
||||
};
|
||||
|
||||
/*
|
||||
* SDKs for 10.13 and 10.14 omit the definitions for API_AVAILABLE where
|
||||
* __attribute__((availability)) is not supported.
|
||||
*/
|
||||
fix = {
|
||||
hackname = darwin_api_availability;
|
||||
mach = "*-*-darwin*";
|
||||
files = os/availability.h;
|
||||
bypass = "__IPHONE_OS_VERSION_MIN_REQUIRED";
|
||||
select =
|
||||
" *#define __API_AVAILABLE.*\n"
|
||||
" *#define __API_DEPRECATED.*\n"
|
||||
" *#define __API_DEPRECATED_WITH_REPLACEMENT.*\n"
|
||||
" *#define __API_UNAVAILABLE.*\n";
|
||||
c_fix = format;
|
||||
c_fix_arg =
|
||||
" #define API_AVAILABLE(...)\n"
|
||||
" #define API_DEPRECATED(...)\n"
|
||||
" #define API_DEPRECATED_WITH_REPLACEMENT(...)\n"
|
||||
" #define API_UNAVAILABLE(...)\n";
|
||||
test_text =
|
||||
"#define __API_AVAILABLE(...)\n"
|
||||
"#define __API_DEPRECATED(...)\n"
|
||||
"#define __API_DEPRECATED_WITH_REPLACEMENT(...)\n"
|
||||
"#define __API_UNAVAILABLE(...)\n";
|
||||
};
|
||||
|
||||
/*
|
||||
* This fixes __FD_ZERO bug for linux 2.x.y (x <= 2 && y <= some n)
|
||||
*/
|
||||
|
18
fixincludes/tests/base/os/availability.h
Normal file
18
fixincludes/tests/base/os/availability.h
Normal file
@ -0,0 +1,18 @@
|
||||
/* DO NOT EDIT THIS FILE.
|
||||
|
||||
It has been auto-edited by fixincludes from:
|
||||
|
||||
"fixinc/tests/inc/os/availability.h"
|
||||
|
||||
This had to be done to correct non-standard usages in the
|
||||
original, manufacturer supplied header file. */
|
||||
|
||||
|
||||
|
||||
#if defined( DARWIN_API_AVAILABILITY_CHECK )
|
||||
#define API_AVAILABLE(...)
|
||||
#define API_DEPRECATED(...)
|
||||
#define API_DEPRECATED_WITH_REPLACEMENT(...)
|
||||
#define API_UNAVAILABLE(...)
|
||||
|
||||
#endif /* DARWIN_API_AVAILABILITY_CHECK */
|
Loading…
x
Reference in New Issue
Block a user