[committed] Add include hack to fix missing SCNuMAX defines in inttypes.h on hpux11.[01]*
diff mbox series

Message ID 34bff4f7-c91b-1bdc-f530-85e5d645a090@bell.net
State New
Headers show
Series
  • [committed] Add include hack to fix missing SCNuMAX defines in inttypes.h on hpux11.[01]*
Related show

Commit Message

John David Anglin Jan. 25, 2020, 5:34 p.m. UTC
In porting git trunk to hppa2.0w-hp-hpux11.11, I found that we lack defines for SCNuMAX:
https://public-inbox.org/git/c9aa5047-7438-8f2f-985c-1c8771354211@bell.net/T/#u

This patch adds the missing defines.

Tested on hppa2.0w-hp-hpux11.11.  Committed to trunk.

Dave

2020-01-25  John David Anglin  <danglin@gcc.gnu.org>

	* inclhack.def (hpux_c99_inttypes4): New, add missing SCNuMAX defines.
	* fixincl.x: Regenerate.
	* tests/base/inttypes.h: Update for above fix.

 fixincludes/inclhack.def          | 15 +++++++++++++++
 fixincludes/tests/base/inttypes.h |  9 +++++++++
 2 files changed, 24 insertions(+)

Comments

Bruce Korb Jan. 29, 2020, 2:11 a.m. UTC | #1
On 1/25/20 9:34 AM, John David Anglin wrote:
> +/*
> + * Fix missing SCNuMAX defines in inttypes.h
> + */
> +fix = {
> +    hackname  = hpux_c99_inttypes4;
> +    mach      = "hppa*-hp-hpux11.[01]*";
> +    files     = inttypes.h;
> +    sed       = "/^[ \t]*#[ \t]*define[ \t]*SCNxMAX[ \t]*SCNx64/a\\\n"
> +		"#define SCNuMAX \t SCNu64\n";
> +    sed       = "/^[ \t]*#[ \t]*define[ \t]*SCNxMAX[ \t]*SCNx32/a\\\n"
> +		"#define SCNuMAX \t SCNu32\n";
> +    test_text = "#define SCNxMAX SCNx64\n"
> +		"#define SCNxMAX SCNx32\n";
> +};
> +
"<space><tab><space>" in the inserted text? OK. It works...

Patch
diff mbox series

diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index bf136fdaa20..f58e7771e1c 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -2613,6 +2613,21 @@  fix = {
 		"#define UINTPTR_MAX\n";
 };

+/*
+ * Fix missing SCNuMAX defines in inttypes.h
+ */
+fix = {
+    hackname  = hpux_c99_inttypes4;
+    mach      = "hppa*-hp-hpux11.[01]*";
+    files     = inttypes.h;
+    sed       = "/^[ \t]*#[ \t]*define[ \t]*SCNxMAX[ \t]*SCNx64/a\\\n"
+		"#define SCNuMAX \t SCNu64\n";
+    sed       = "/^[ \t]*#[ \t]*define[ \t]*SCNxMAX[ \t]*SCNx32/a\\\n"
+		"#define SCNuMAX \t SCNu32\n";
+    test_text = "#define SCNxMAX SCNx64\n"
+		"#define SCNxMAX SCNx32\n";
+};
+
 /*
  *  Fix hpux broken ctype macros
  */
diff --git a/fixincludes/tests/base/inttypes.h b/fixincludes/tests/base/inttypes.h
index e2216832666..144ea6596e8 100644
--- a/fixincludes/tests/base/inttypes.h
+++ b/fixincludes/tests/base/inttypes.h
@@ -33,3 +33,12 @@ 
 #endif

 #endif  /* HPUX_C99_INTTYPES3_CHECK */
+
+
+#if defined( HPUX_C99_INTTYPES4_CHECK )
+#define SCNxMAX SCNx64
+#define SCNuMAX 	 SCNu64
+#define SCNxMAX SCNx32
+#define SCNuMAX 	 SCNu32
+
+#endif  /* HPUX_C99_INTTYPES4_CHECK */