+2023-04-05 Bruno Haible <bruno@clisp.org>
+
+ uchar: Work around Haiku bug.
+ * m4/uchar_h.m4 (gl_UCHAR_H, gl_TYPE_CHAR8_T, gl_TYPE_CHAR16_T,
+ gl_TYPE_CHAR32_T): Before including <uchar.h>, on Haiku, first include
+ <stdint.h>.
+ * m4/c32rtomb.m4 (gl_FUNC_C32RTOMB): Likewise.
+ * m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32, gl_CHECK_FUNC_MBRTOC32,
+ gl_MBRTOC32_EMPTY_INPUT, gl_MBRTOC32_C_LOCALE, gl_MBRTOC32_SANITYCHECK):
+ Likewise.
+ * lib/uchar.in.h: On Haiku, include <stdint.h> before the include_next.
+ * doc/posix-headers/uchar.texi: Mention the Haiku bug.
+
2023-04-05 Bruno Haible <bruno@clisp.org>
stdlib, btowc: Fix file lists.
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 is not self-contained on some platforms:
+@c https://dev.haiku-os.org/ticket/17040
+Haiku.
+@item
This file produces compilation errors in C++ mode on some platforms:
AIX 7.2 with xlclang++.
@end itemize
@PRAGMA_COLUMNS@
#if @HAVE_UCHAR_H@
+# if defined __HAIKU__
+/* Work around <https://dev.haiku-os.org/ticket/17040>. */
+# include <stdint.h>
+# endif
/* 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,
-# c32rtomb.m4 serial 5
+# c32rtomb.m4 serial 6
dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
dnl Cf. gl_CHECK_FUNCS_ANDROID
- AC_CHECK_DECL([c32rtomb], , , [[#include <uchar.h>]])
+ AC_CHECK_DECL([c32rtomb], , ,
+ [[#ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
+ #include <uchar.h>
+ ]])
if test $ac_cv_have_decl_c32rtomb = yes; then
dnl We can't use AC_CHECK_FUNC here, because c32rtomb() is defined as a
dnl static inline function on Haiku 2020.
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdlib.h>
+ #ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
#include <uchar.h>
]],
[[char buf[8];
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stddef.h>
+#ifdef __HAIKU__
+ #include <stdint.h>
+#endif
#include <uchar.h>
int main ()
{
-# mbrtoc32.m4 serial 11
+# mbrtoc32.m4 serial 12
dnl Copyright (C) 2014-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_CHECK_FUNC_MBRTOC32],
[
dnl Cf. gl_CHECK_FUNCS_ANDROID
- AC_CHECK_DECL([mbrtoc32], , , [[#include <uchar.h>]])
+ AC_CHECK_DECL([mbrtoc32], , ,
+ [[#ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
+ #include <uchar.h>
+ ]])
if test $ac_cv_have_decl_mbrtoc32 = yes; then
dnl We can't use AC_CHECK_FUNC here, because mbrtoc32() is defined as a
dnl static inline function on Haiku 2020.
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdlib.h>
+ #ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
#include <uchar.h>
]],
[[char32_t c;
changequote([,])dnl
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
+ #ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
#include <uchar.h>
static char32_t wc;
static mbstate_t mbs;
[AC_LANG_PROGRAM(
[[#include <limits.h>
#include <locale.h>
+ #ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
#include <uchar.h>
]], [[
int i;
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
+#ifdef __HAIKU__
+ #include <stdint.h>
+#endif
#include <uchar.h>
int main ()
{
-# uchar_h.m4 serial 21
+# uchar_h.m4 serial 22
dnl Copyright (C) 2019-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
dnl guaranteed by C11.
- gl_WARN_ON_USE_PREPARE([[#include <uchar.h>
+ gl_WARN_ON_USE_PREPARE([[
+ #ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
+ #include <uchar.h>
]], [c32rtomb mbrtoc32])
])
[gl_cv_type_char8_t_works],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
+ #ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
#include <uchar.h>
int verify[(char8_t)(-1) >= 0 && sizeof (char8_t) == sizeof (unsigned char) ? 1 : -1];
]])
[gl_cv_type_char16_t_works],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
+ #ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
#include <uchar.h>
/* For simplicity, assume that uint16_least_t is equivalent to
'unsigned short'. */
[gl_cv_type_char32_t_works],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
+ #ifdef __HAIKU__
+ #include <stdint.h>
+ #endif
#include <uchar.h>
/* For simplicity, assume that uint32_least_t is equivalent to
'unsigned int'. */