This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, committed] HP-UX fixincludes patch and README change


This fixincludes patch was created by Bruce Korb to reduce the number
of HP-UX fixes.  It also includes a README change to document the
files entry in inclhack.def.  I tested it on ia64-hp-hpux11.23 and
verified that it results in the same basic fixes and that it still
passes the fixincludes testing and will commit it shortly.

Steve Ellcey
sje@cup.hp.com


2009-08-28   Bruce Korb <bkorb@gnu.org>
	     Steve Ellcey  <sje@cup.hp.com>
	    

	* README (files): Describe files entry.
	* inclhack.def (hpux_stdint_least): Remove.
	(hpux_stdint_fast): Remove.
	(hpux_stdint_fast): Remove.
	(hpux_stdint_least_fast): New.
	(hpux_inttype_int_least8_t): Remove.
	(hpux_inttype_int8_t): Modify.
	* fixincl.x: Regenerate.
	* tests/base/stdint.h: Update.
	* tests/base/sys/_inttypes.h: Update.


Index: README
===================================================================
--- README	(revision 151171)
+++ README	(working copy)
@@ -89,6 +89,11 @@ MAKING CHANGES TO INCLHACK.DEF
 
     * c-test - call a function in fixtests.c.  See that file.
 
+    * files  - the "fnmatch" pattern of the file(s) to examine for
+               the issue.  There may be several copies of this attribute.
+               If the header lives in a /usr/include subdirectory, be
+               sure to include that subdirectory in the name. e.g. net/if.h
+
     * mach   - Match the output of config.conf against a series of fnmatch
                patterns.  It must match at least one of the patterns, unless
                "not-machine" has also been specified.  In that case, the
Index: inclhack.def
===================================================================
--- inclhack.def	(revision 151171)
+++ inclhack.def	(working copy)
@@ -2190,43 +2190,34 @@ fix = {
 };
 
 fix = {
-    hackname  = hpux_stdint_least;
+    hackname  = hpux_stdint_least_fast;
     mach      = "*-hp-hpux11.2*";
     files     = stdint.h;
-    select    = "^[ \t]*#[ \t]*define[ \t]*UINT_LEAST64_MAX[ \t]*ULLONG_MAX";
-    c_fix     = format;
-    c_fix_arg = "#ifdef __LP64__\n#  define	UINT_LEAST64_MAX	ULONG_MAX\n#else\n%0\n#endif\n";
-    test_text ="#  define       UINT_LEAST64_MAX        ULLONG_MAX\n";
-};
-
-fix = {
-    hackname  = hpux_stdint_fast;
-    mach      = "*-hp-hpux11.2*";
-    files     = stdint.h;
-    select    = "^[ \t]*#[ \t]*define[ \t]*UINT_FAST64_MAX[ \t]*ULLONG_MAX";
-    c_fix     = format;
-    c_fix_arg = "#ifdef __LP64__\n#  define	UINT_FAST64_MAX		ULONG_MAX\n#else\n%0\n#endif\n";
-    test_text ="#  define       UINT_FAST64_MAX        ULLONG_MAX\n";
-};
-
-fix = {
-    hackname  = hpux_inttype_int_least8_t;
-    mach      = "*-hp-hpux1[01].*";
-    files     = sys/_inttypes.h;
-    select    = "^[ \t]*typedef[ \t]*char[ \t]*int_least8_t.*";
+    select    =
+        "^[ \t]*#[ \t]*define[ \t]+UINT_(LEAST|FAST)64_MAX[ \t]+ULLONG_MAX";
     c_fix     = format;
-    c_fix_arg = "typedef signed char int_least8_t;";
-    test_text ="typedef char int_least8_t;\n";
+    c-fix-arg = <<- _EOFix_
+	#ifdef __LP64__
+	#  define	UINT_%164_MAX	ULONG_MAX
+	#else
+	%0
+	#endif
+	_EOFix_;
+    test-text = <<- _EOFix_
+	#  define       UINT_FAST64_MAX        ULLONG_MAX
+	#  define       UINT_LEAST64_MAX        ULLONG_MAX
+	_EOFix_;
 };
 
 fix = {
     hackname  = hpux_inttype_int8_t;
     mach      = "*-hp-hpux1[01].*";
     files     = sys/_inttypes.h;
-    select    = "^[ \t]*typedef[ \t]*char[ \t]*int8_t.*";
+    select    = "^[ \t]*typedef[ \t]*char[ \t]*int(_least){0,1}8_t.*";
     c_fix     = format;
-    c_fix_arg = "typedef signed char int8_t;";
-    test_text ="typedef char int8_t;\n";
+    c_fix_arg = "typedef signed char int%18_t;";
+    test_text = "typedef char int_least8_t;\n"
+                "typedef char int8_t;\n";
 };
 
 fix = {
Index: tests/base/stdint.h
===================================================================
--- tests/base/stdint.h	(revision 151171)
+++ tests/base/stdint.h	(working copy)
@@ -145,26 +145,18 @@
 #endif  /* HPUX_C99_INTTYPES2_CHECK */
 
 
-#if defined( HPUX_STDINT_LEAST_CHECK )
+#if defined( HPUX_STDINT_LEAST_FAST_CHECK )
 #ifdef __LP64__
-#  define	UINT_LEAST64_MAX	ULONG_MAX
+#  define	UINT_FAST64_MAX	ULONG_MAX
 #else
-#  define       UINT_LEAST64_MAX        ULLONG_MAX
+#  define       UINT_FAST64_MAX        ULLONG_MAX
 #endif
-
-
-#endif  /* HPUX_STDINT_LEAST_CHECK */
-
-
-#if defined( HPUX_STDINT_FAST_CHECK )
 #ifdef __LP64__
-#  define	UINT_FAST64_MAX		ULONG_MAX
+#  define	UINT_LEAST64_MAX	ULONG_MAX
 #else
-#  define       UINT_FAST64_MAX        ULLONG_MAX
+#  define       UINT_LEAST64_MAX        ULLONG_MAX
 #endif
-
-
-#endif  /* HPUX_STDINT_FAST_CHECK */
+#endif  /* HPUX_STDINT_LEAST_FAST_CHECK */
 
 
 #if defined( IRIX_STDINT_C99_CHECK )
Index: tests/base/sys/_inttypes.h
===================================================================
--- tests/base/sys/_inttypes.h	(revision 151171)
+++ tests/base/sys/_inttypes.h	(working copy)
@@ -9,13 +9,8 @@
 
 
 
-#if defined( HPUX_INTTYPE_INT_LEAST8_T_CHECK )
-typedef signed char int_least8_t;
-
-#endif  /* HPUX_INTTYPE_INT_LEAST8_T_CHECK */
-
-
 #if defined( HPUX_INTTYPE_INT8_T_CHECK )
+typedef signed char int_least8_t;
 typedef signed char int8_t;
 
 #endif  /* HPUX_INTTYPE_INT8_T_CHECK */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]