[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
wchar: make the HP-UX workaround work on HP-UX 11.31
From: |
Bruno Haible |
Subject: |
wchar: make the HP-UX workaround work on HP-UX 11.31 |
Date: |
Thu, 02 Jan 2020 14:02:04 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-170-generic; KDE/5.18.0; x86_64; ; ) |
On HP-UX 11.31 I observe that the gnulib overrides in <wchar.h> are not
activated. This is caused by the #if at the beginning of the file, which
contains a prevention against trouble on HP-UX 11.00.
The difference between HP-UX 11.00 and 11.31 here is that in 11.00 the
system's <inttypes.h> defines 'strtoimax' as a macro, which we could use
to test whether <inttypes.h> has being completely included or not. This
trick does not work with 11.31 any more, because it no longer defines
such macros in <inttypes.h>.
This patch fixes it, by providing our own witness macro that tells whether
the system's <inttypes.h> has being completely included.
2020-01-02 Bruno Haible <address@hidden>
wchar: Make the HP-UX workaround work on HP-UX 11.31.
* modules/wchar (Depends-on): Add inttypes-incomplete.
* lib/inttypes.in.h: Define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H.
* lib/wchar.in.h: Test _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H instead
of strtoimax.
diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h
index 5184e26..d6efc7e 100644
--- a/lib/inttypes.in.h
+++ b/lib/inttypes.in.h
@@ -38,6 +38,8 @@
# endif
# @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
+
+# define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H
# endif
#endif
diff --git a/lib/wchar.in.h b/lib/wchar.in.h
index 3eaa7a6..834b3e8 100644
--- a/lib/wchar.in.h
+++ b/lib/wchar.in.h
@@ -33,7 +33,8 @@
#if (((defined __need_mbstate_t || defined __need_wint_t) \
&& !defined __MINGW32__) \
|| (defined __hpux \
- && ((defined _INTTYPES_INCLUDED && !defined strtoimax) \
+ && ((defined _INTTYPES_INCLUDED \
+ && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H) \
|| defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \
|| (defined __MINGW32__ && defined __STRING_H_SOURCED__) \
|| defined _GL_ALREADY_INCLUDING_WCHAR_H)
diff --git a/modules/wchar b/modules/wchar
index a943740..cd4464b 100644
--- a/modules/wchar
+++ b/modules/wchar
@@ -12,6 +12,7 @@ include_next
snippet/arg-nonnull
snippet/c++defs
snippet/warn-on-use
+inttypes-incomplete
stddef
configure.ac:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- wchar: make the HP-UX workaround work on HP-UX 11.31,
Bruno Haible <=