diff options
-rw-r--r-- | fixincludes/fixincl.x | 60 | ||||
-rw-r--r-- | fixincludes/inclhack.def | 24 | ||||
-rw-r--r-- | fixincludes/tests/base/bits/floatn.h | 12 |
3 files changed, 87 insertions, 9 deletions
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 6309723..ff3c724 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed September 27, 2022 at 12:21:44 PM by AutoGen 5.18.16 + * It has been AutoGen-ed September 28, 2022 at 07:56:15 PM by AutoGen 5.18.16 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Sep 27 12:21:44 CEST 2022 +/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Sep 28 19:56:15 CEST 2022 * * 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 270 fixup descriptions. + * This file contains 271 fixup descriptions. * * See README for more information. * @@ -4167,7 +4167,7 @@ tSCC zGlibc_Cxx_Floatn_2List[] = * content selection pattern - do fix if pattern found */ tSCC zGlibc_Cxx_Floatn_2Select0[] = - "^([ \t]*#[ \t]*if !__GNUC_PREREQ \\(7, 0\\) \\|\\| )defined __cplusplus\n\ + "^([ \t]*#[ \t]*(el)?if !__GNUC_PREREQ \\(7, 0\\) \\|\\| )defined __cplusplus\n\ (([ \t]*/\\*[^\n\ ]*\\*/\n\ )?[ \t]*typedef[ \t]+[^\n\ @@ -4183,7 +4183,7 @@ static tTestDesc aGlibc_Cxx_Floatn_2Tests[] = { static const char* apzGlibc_Cxx_Floatn_2Patch[] = { "format", "%1(defined __cplusplus && !__GNUC_PREREQ (13, 0))\n\ -%2", +%3", (char*)NULL }; /* * * * * * * * * * * * * * * * * * * * * * * * * * @@ -4233,6 +4233,46 @@ static const char* apzGlibc_Cxx_Floatn_3Patch[] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Glibc_Cxx_Floatn_4 fix + */ +tSCC zGlibc_Cxx_Floatn_4Name[] = + "glibc_cxx_floatn_4"; + +/* + * File name selection pattern + */ +tSCC zGlibc_Cxx_Floatn_4List[] = + "bits/floatn.h\0*/bits/floatn.h\0"; +/* + * Machine/OS name selection pattern + */ +#define apzGlibc_Cxx_Floatn_4Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zGlibc_Cxx_Floatn_4Select0[] = + "^([ \t]*#[ \t]*if __LDBL_MANT_DIG__ == 113 && )defined __cplusplus\n\ +(([ \t]*/\\*[^\n\ +]*\\*/\n\ +)?[ \t]*typedef[ \t]+[^\n\ +]*[ \t]+_Float128;)"; + +#define GLIBC_CXX_FLOATN_4_TEST_CT 1 +static tTestDesc aGlibc_Cxx_Floatn_4Tests[] = { + { TT_EGREP, zGlibc_Cxx_Floatn_4Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Glibc_Cxx_Floatn_4 + */ +static const char* apzGlibc_Cxx_Floatn_4Patch[] = { + "format", + "%1defined __cplusplus && !__GNUC_PREREQ (13, 0)\n\ +%2", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Glibc_Mutex_Init fix */ tSCC zGlibc_Mutex_InitName[] = @@ -10998,9 +11038,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 308 +#define REGEX_COUNT 309 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 270 +#define FIX_COUNT 271 /* * Enumerate the fixes @@ -11106,6 +11146,7 @@ typedef enum { GLIBC_CXX_FLOATN_1_FIXIDX, GLIBC_CXX_FLOATN_2_FIXIDX, GLIBC_CXX_FLOATN_3_FIXIDX, + GLIBC_CXX_FLOATN_4_FIXIDX, GLIBC_MUTEX_INIT_FIXIDX, GLIBC_STDINT_FIXIDX, GLIBC_STRNCPY_FIXIDX, @@ -11779,6 +11820,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { GLIBC_CXX_FLOATN_3_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aGlibc_Cxx_Floatn_3Tests, apzGlibc_Cxx_Floatn_3Patch, 0 }, + { zGlibc_Cxx_Floatn_4Name, zGlibc_Cxx_Floatn_4List, + apzGlibc_Cxx_Floatn_4Machs, + GLIBC_CXX_FLOATN_4_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aGlibc_Cxx_Floatn_4Tests, apzGlibc_Cxx_Floatn_4Patch, 0 }, + { zGlibc_Mutex_InitName, zGlibc_Mutex_InitList, apzGlibc_Mutex_InitMachs, GLIBC_MUTEX_INIT_TEST_CT, FD_MACH_ONLY, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 88bf28f..71f1c47 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -2060,11 +2060,11 @@ fix = { fix = { hackname = glibc_cxx_floatn_2; files = bits/floatn.h, bits/floatn-common.h, "*/bits/floatn.h", "*/bits/floatn-common.h"; - select = "^([ \t]*#[ \t]*if !__GNUC_PREREQ \\(7, 0\\) \\|\\| )defined __cplusplus\n" + select = "^([ \t]*#[ \t]*(el)?if !__GNUC_PREREQ \\(7, 0\\) \\|\\| )defined __cplusplus\n" "(([ \t]*/\\*[^\n]*\\*/\n)?" "[ \t]*typedef[ \t]+[^\n]*[ \t]+_Float(16|32|64|128)x?([ \t]+__attribute__ \\(\\(__mode__ \\(__HF__\\)\\)\\))?;)"; c_fix = format; - c_fix_arg = "%1(defined __cplusplus && !__GNUC_PREREQ (13, 0))\n%2"; + c_fix_arg = "%1(defined __cplusplus && !__GNUC_PREREQ (13, 0))\n%3"; test_text = <<-EOT # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef float _Float16 __attribute__ ((__mode__ (__HF__))); @@ -2072,6 +2072,10 @@ fix = { # if !__GNUC_PREREQ (7, 0) || defined __cplusplus typedef __float128 _Float128; # endif + # if 0 + # elif !__GNUC_PREREQ (7, 0) || defined __cplusplus + typedef __float128 _Float128; + # endif EOT; }; @@ -2111,6 +2115,22 @@ fix = { EOT; }; +fix = { + hackname = glibc_cxx_floatn_4; + files = bits/floatn.h, "*/bits/floatn.h"; + select = "^([ \t]*#[ \t]*if __LDBL_MANT_DIG__ == 113 && )defined __cplusplus\n" + "(([ \t]*/\\*[^\n]*\\*/\n)?" + "[ \t]*typedef[ \t]+[^\n]*[ \t]+_Float128;)"; + c_fix = format; + c_fix_arg = "%1defined __cplusplus && !__GNUC_PREREQ (13, 0)\n%2"; + test_text = <<-EOT + # if __LDBL_MANT_DIG__ == 113 && defined __cplusplus + typedef long double _Float128; + # define __CFLOAT128 _Complex long double + # endif + EOT; +}; + /* glibc-2.3.5 defines pthread mutex initializers incorrectly, * so we replace them with versions that correspond to the * definition. diff --git a/fixincludes/tests/base/bits/floatn.h b/fixincludes/tests/base/bits/floatn.h index f09528b..c80941f 100644 --- a/fixincludes/tests/base/bits/floatn.h +++ b/fixincludes/tests/base/bits/floatn.h @@ -45,6 +45,10 @@ typedef float _Float16 __attribute__ ((__mode__ (__HF__))); # if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) typedef __float128 _Float128; # endif +# if 0 +# elif !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) +typedef __float128 _Float128; +# endif #endif /* GLIBC_CXX_FLOATN_2_CHECK */ @@ -72,3 +76,11 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); # define __CFLOAT64 _Complex _Float64 # endif #endif /* GLIBC_CXX_FLOATN_3_CHECK */ + + +#if defined( GLIBC_CXX_FLOATN_4_CHECK ) +# if __LDBL_MANT_DIG__ == 113 && defined __cplusplus && !__GNUC_PREREQ (13, 0) +typedef long double _Float128; +# define __CFLOAT128 _Complex long double +# endif +#endif /* GLIBC_CXX_FLOATN_4_CHECK */ |