--- fixincludes/fixincl.x.orig 2015-08-12 14:28:28.000000000 +0900 +++ fixincludes/fixincl.x 2020-01-03 11:33:28.000000000 +0900 @@ -2855,6 +2855,48 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Darwin_Ucred__Atomic fix + */ +tSCC zDarwin_Ucred__AtomicName[] = + "darwin_ucred__Atomic"; + +/* + * File name selection pattern + */ +tSCC zDarwin_Ucred__AtomicList[] = + "sys/ucred.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzDarwin_Ucred__AtomicMachs[] = { + "*-*-darwin*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zDarwin_Ucred__AtomicSelect0[] = + "_Atomic"; + +#define DARWIN_UCRED__ATOMIC_TEST_CT 1 +static tTestDesc aDarwin_Ucred__AtomicTests[] = { + { TT_EGREP, zDarwin_Ucred__AtomicSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Darwin_Ucred__Atomic + */ +static const char* apzDarwin_Ucred__AtomicPatch[] = { + "wrap", + "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n\ +# define _Atomic volatile\n\ +#endif\n", + "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n\ +# undef _Atomic\n\ +#endif\n", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Dec_Intern_Asm fix */ tSCC zDec_Intern_AsmName[] = @@ -9396,9 +9438,9 @@ * * List of all fixes */ -#define REGEX_COUNT 266 +#define REGEX_COUNT 267 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 229 +#define FIX_COUNT 230 /* * Enumerate the fixes @@ -9469,6 +9511,7 @@ DARWIN_STDINT_5_FIXIDX, DARWIN_STDINT_6_FIXIDX, DARWIN_STDINT_7_FIXIDX, + DARWIN_UCRED__ATOMIC_FIXIDX, DEC_INTERN_ASM_FIXIDX, DJGPP_WCHAR_H_FIXIDX, ECD_CURSOR_FIXIDX, @@ -9961,6 +10004,11 @@ DARWIN_STDINT_7_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aDarwin_Stdint_7Tests, apzDarwin_Stdint_7Patch, 0 }, + { zDarwin_Ucred__AtomicName, zDarwin_Ucred__AtomicList, + apzDarwin_Ucred__AtomicMachs, + DARWIN_UCRED__ATOMIC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aDarwin_Ucred__AtomicTests, apzDarwin_Ucred__AtomicPatch, 0 }, + { zDec_Intern_AsmName, zDec_Intern_AsmList, apzDec_Intern_AsmMachs, DEC_INTERN_ASM_TEST_CT, FD_MACH_ONLY, --- fixincludes/inclhack.def.orig 2015-08-12 14:28:28.000000000 +0900 +++ fixincludes/inclhack.def 2020-01-03 11:35:22.000000000 +0900 @@ -1524,6 +1524,25 @@ "#define UINTMAX_C(v) (v ## ULL)"; }; +/* The SDK included with XCode 10.2 has the file that uses the + C11 _Atomic keyword (exposing it to C++ code). The work-around here follows + the header in declaring the entity volatile when _Atomic is not available. +*/ +fix = { + hackname = darwin_ucred__Atomic; + mach = "*-*-darwin*"; + files = sys/ucred.h; + select = "_Atomic"; + c_fix = wrap; + c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n" + "# define _Atomic volatile\n" + "#endif\n"; + c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n" + "# undef _Atomic\n" + "#endif\n"; + test_text = "_Atomic"; +}; + /* * Fix on Digital UNIX V4.0: * It contains a prototype for a DEC C internal asm() function,