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-1c8771354...@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 <dang...@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(+) 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 */