]> Savannah Git Hosting - gnulib.git/commitdiff
uchar: Work around error in C++ mode on AIX 7.2 with xlclang.
authorBruno Haible <bruno@clisp.org>
Sat, 10 Sep 2022 16:56:14 +0000 (18:56 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 10 Sep 2022 17:02:29 +0000 (19:02 +0200)
* lib/uchar.in.h (char16_t, char32_t): On AIX with xlclang++, define
these as macros.
* doc/posix-headers/uchar.texi: Document the AIX + xlclang++ bug.

ChangeLog
doc/posix-headers/uchar.texi
lib/uchar.in.h

index cb60228ec3fc586c6968e358fa479e3ba5824f1b..8b8f32ad176df14caa927c42c119f192015a4b45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-09-10  Bruno Haible  <bruno@clisp.org>
+
+       uchar: Work around error in C++ mode on AIX 7.2 with xlclang.
+       * lib/uchar.in.h (char16_t, char32_t): On AIX with xlclang++, define
+       these as macros.
+       * doc/posix-headers/uchar.texi: Document the AIX + xlclang++ bug.
+
 2022-09-10  Paul Eggert  <eggert@cs.ucla.edu>
 
        Rely on new stdbool behavior
index ce5ecaf6a835deb234cff788d5769e8aafb420cf..945ce665fd5920a1b79dc317b449361b6eb6dbe7 100644 (file)
@@ -12,6 +12,9 @@ Portability problems fixed by Gnulib:
 @item
 This header file is missing on many non-glibc platforms:
 glibc 2.15, macOS 11.1, FreeBSD 6.4, NetBSD 9.0, OpenBSD 6.7, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.3, Cygwin, mingw, MSVC 9.
+@item
+This file produces compilation errors in C++ mode on some platforms:
+AIX 7.2 with xlclang++.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index e6a5cddf86bd638c593fe5ff29d991e4697c919f..15fd7bc1ebfb4430e61e22616cd879b2312ffb19 100644 (file)
 @PRAGMA_COLUMNS@
 
 #if @HAVE_UCHAR_H@
+/* On AIX 7.2 with xlclang++, /usr/include/uchar.h produces compilation errors
+   because it contains typedef definitions of char16_t and char32_t, however
+   char16_t and char32_t are keywords in this situation.  To work around it,
+   define char16_t and char32_t as macros.  */
+# if defined __cplusplus && defined _AIX && defined __ibmxl__ && defined __clang__
+#  define char16_t gl_char16_t
+#  define char32_t gl_char32_t
+# endif
 # @INCLUDE_NEXT@ @NEXT_UCHAR_H@
 #endif