OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / fixincludes / inclhack.def
index 4a5af1d..e1d413c 100644 (file)
@@ -386,23 +386,6 @@ fix = {
 
 
 /*
- *  sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the
- *  definition of struct rusage, so the prototype added by fixproto fails.
- */
-fix = {
-    hackname  = aix_syswait;
-    files     = sys/wait.h;
-    select    = "^extern pid_t wait3\\(\\);\n";
-    select    = "bos325,";
-    c_fix     = format;
-    c_fix_arg = "struct rusage;\n%0";
-    test_text = "/* bos325, */\n"
-    "extern pid_t wait3();\n"
-    "\t/* pid_t wait3(int *, int, struct rusage *); */";
-};
-
-
-/*
  *  sys/wait.h on AIX 5.2 defines macros that have both signed and
  *  unsigned types in conditional expressions.
  */
@@ -1089,26 +1072,6 @@ fix = {
 
 
 /*
- *  math.h on SunOS 4 puts the declaration of matherr before the definition
- *  of struct exception, so the prototype (added by fixproto) causes havoc.
- *  This must appear before the math_exception fix.
- */
-fix = {
-    hackname  = exception_structure;
-    files     = math.h;
-
-    /*  If matherr has a prototype already, the header needs no fix.  */
-    bypass    = 'matherr.*(struct exception|__MATH_EXCEPTION|[ \t]*__FP_EXCEPTION[ \t]*\*[ \t]*)';
-    select    = matherr;
-
-    c_fix     = wrap;
-    c_fix_arg = "struct exception;\n";
-
-    test_text = "extern int matherr();";
-};
-
-
-/*
  *  Between 8/24/1998 and 2/17/2001, FreeBSD system headers presume
  *  neither the existence of GCC 3 nor its exact feature set yet break
  *  (by design?) when __GNUC__ is set beyond 2.
@@ -1302,6 +1265,19 @@ fix = {
 };
 
 
+/* glibc's tgmath.h relies on an expression that is not an integer
+   constant expression being treated as it was by GCC 4.4 and
+   earlier.  */
+fix = {
+    hackname  = glibc_tgmath;
+    files     = tgmath.h;
+    select    = '\(\(\(type\) 0.25\) && \(\(type\) 0.25 - 1\)\)';
+    bypass    = "__floating_type \\\\\n.*__builtin_classify_type";
+    c_fix     = format;
+    c_fix_arg = "(__builtin_classify_type ((type) 0) == 8 || (__builtin_classify_type ((type) 0) == 9 && __builtin_classify_type (__real__ ((type) 0)) == 8))";
+    test_text = "# define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1))";
+};
+
 /*
  * Fix these files to use the types we think they should for
  * ptrdiff_t, size_t, and wchar_t.
@@ -2306,9 +2282,7 @@ fix = {
  *  Interface Definition), which conflicts with the class exception defined
  *  in the C++ file std/stdexcept.h.  We redefine it to __math_exception.
  *  This is not a great fix, but I haven't been able to think of anything
- *  better.  Note that we have to put the #ifdef/#endif blocks at beginning
- *  and end of file, because fixproto runs after us and may insert
- *  additional references to struct exception.
+ *  better.
  */
 fix = {
     hackname  = math_exception;
@@ -2456,6 +2430,64 @@ fix = {
 };
 
 
+/* newlib's stdint.h has several failures to conform to C99.  The fix
+   for these removed a comment that can be matched to identify unfixed
+   versions.  */
+fix = {
+    hackname  = newlib_stdint_1;
+    files     = stdint.h;
+    select    = "@todo - Add support for wint_t types";
+    sed       = "s@#define INT32_MIN.*@#define INT32_MIN (-INT32_MAX - 1)@";
+    sed       = "s@#define INT32_MAX.*@#define INT32_MAX __INT32_MAX__@";
+    sed       = "s@#define UINT32_MAX.*@#define UINT32_MAX __UINT32_MAX__@";
+    sed       = "s@#define INT_LEAST32_MIN.*@#define INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)@";
+    sed       = "s@#define INT_LEAST32_MAX.*@#define INT_LEAST32_MAX __INT_LEAST32_MAX__@";
+    sed       = "s@#define UINT_LEAST32_MAX.*@#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__@";
+    sed       = 's@#define INT_FAST\([0-9]*\)_MIN.*@#define INT_FAST\1_MIN (-INT_FAST\1_MAX - 1)@';
+    sed       = 's@#define INT_FAST\([0-9]*\)_MAX.*@#define INT_FAST\1_MAX __INT_FAST\1_MAX__@';
+    sed       = 's@#define UINT_FAST\([0-9]*\)_MAX.*@#define UINT_FAST\1_MAX __UINT_FAST\1_MAX__@';
+    sed       = "s@#define SIZE_MAX.*@#define SIZE_MAX __SIZE_MAX__@";
+    sed       = "s@#define PTRDIFF_MIN.*@#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)@";
+    sed       = "s@#define PTRDIFF_MAX.*@#define PTRDIFF_MAX __PTRDIFF_MAX__@";
+    sed       = "s@#define UINT8_C.*@#define UINT8_C(c) __UINT8_C(c)@";
+    sed       = "s@#define UINT16_C.*@#define UINT16_C(c) __UINT16_C(c)@";
+    test_text = "/* @todo - Add support for wint_t types. */\n"
+                "#define INT32_MIN (-2147483647-1)\n"
+                "#define INT32_MAX 2147483647\n"
+                "#define UINT32_MAX 4294967295U\n"
+                "#define INT_LEAST32_MIN (-2147483647-1)\n"
+                "#define INT_LEAST32_MAX 2147483647\n"
+                "#define UINT_LEAST32_MAX 4294967295U\n"
+                "#define INT_FAST8_MIN INT8_MIN\n"
+                "#define INT_FAST8_MAX INT8_MAX\n"
+                "#define UINT_FAST8_MAX UINT8_MAX\n"
+                "#define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)\n"
+                "#define PTRDIFF_MIN (-__STDINT_EXP(LONG_MAX) - 1L)\n"
+                "#define PTRDIFF_MAX __STDINT_EXP(LONG_MAX)\n"
+                "#define UINT8_C(x) x##U\n"
+                "#define UINT16_C(x) x##U";
+};
+
+
+fix = {
+    hackname  = newlib_stdint_2;
+    files     = stdint.h;
+    select    = "@todo - Add support for wint_t types";
+    c_fix     = format;
+    c_fix_arg = "#define INTMAX_MAX __INTMAX_MAX__\n"
+                "#define INTMAX_MIN (-INTMAX_MAX - 1)\n"
+                "#define UINTMAX_MAX __UINTMAX_MAX__\n"
+                "#define WCHAR_MAX __WCHAR_MAX__\n"
+                "#define WCHAR_MIN __WCHAR_MIN__\n"
+                "#define WINT_MAX __WINT_MAX__\n"
+                "#define WINT_MIN __WINT_MIN__\n\n"
+                "%0";
+    c_fix_arg = '/\*\* Macros for minimum-width integer constant expressions \*/';
+    test_text = "/* @todo - Add support for wint_t types. */\n"
+                "/** Macros for minimum-width integer constant expressions */";
+};
+
+
 /*
  *  NeXT 3.2 adds const prefix to some math functions.
  *  These conflict with the built-in functions.
@@ -2658,20 +2690,6 @@ fix = {
 
 
 /*
- *  Fix __page_size* declarations in pthread.h AIX 4.1.[34].
- *  The original ones fail if uninitialized externs are not common.
- *  This is the default for all ANSI standard C++ compilers.
- */
-fix = {
-    hackname  = pthread_page_size;
-    files     = pthread.h;
-    select    = "^int __page_size";
-    c_fix     = format;
-    c_fix_arg = "extern %0";
-    test_text = "int __page_size;";
-};
-
-/*
  * On broken glibc-2.3.3 systems an array of incomplete structures is
  * passed to __sigsetjmp.  Fix that to take a pointer instead.
  */