* lib/uchar.in.h: New file.
* m4/uchar.m4: New file.
* modules/uchar: New file.
* doc/posix-headers/uchar.texi: Mention the new module.
+2019-12-31 Bruno Haible <bruno@clisp.org>
+
+ uchar: New module.
+ * lib/uchar.in.h: New file.
+ * m4/uchar.m4: New file.
+ * modules/uchar: New file.
+ * doc/posix-headers/uchar.texi: Mention the new module.
+
2019-12-30 Jim Meyering <meyering@fb.com>
localeinfo: ->simple would be wrong for LC_ALL=C
functions @code{mbrtoc16}, @code{c16rtomb}, @code{mbrtoc32},
@code{c32rtomb}.
-Gnulib module: ---
+Gnulib module: uchar
Portability problems fixed by Gnulib:
@itemize
+@item
+This header file is missing on many non-glibc platforms:
+glibc 2.15, Mac OS X 10.5, FreeBSD 6.4, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.3, Cygwin, mingw, MSVC 9.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This header file is missing on many non-glibc platforms:
-glibc 2.15, Mac OS X 10.5, FreeBSD 6.4, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.3, Cygwin, mingw, MSVC 9.
@end itemize
--- /dev/null
+/* <uchar.h> substitute - 16-bit and 32-bit wide character types.
+ Copyright (C) 2019 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019. */
+
+/*
+ * ISO C 11 <uchar.h> for platforms that lack it.
+ */
+
+#ifndef _@GUARD_PREFIX@_UCHAR_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_UCHAR_H@
+# @INCLUDE_NEXT@ @NEXT_UCHAR_H@
+#endif
+
+/* Get uint_least16_t, uint_least32_t. */
+#include <stdint.h>
+
+/* Get mbstate_t, size_t. */
+#include <wchar.h>
+
+#if !@HAVE_UCHAR_H@
+
+/* A 16-bit variant of wchar_t.
+ Note: This type does *NOT* denote UTF-16 units. (Only on platforms
+ on which __STDC_UTF_16__ is defined.) */
+typedef uint_least16_t char16_t;
+
+/* A 32-bit variant of wchar_t.
+ Note: This type does *NOT* denote UTF-32 code points. (Only on platforms
+ on which __STDC_UTF_32__ is defined.) */
+typedef uint_least32_t char32_t;
+
+#endif
+
+#endif /* _@GUARD_PREFIX@_UCHAR_H */
--- /dev/null
+# uchar.m4 serial 1
+dnl Copyright (C) 2019 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 with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Prepare the overridden <uchar.h>.
+
+AC_DEFUN_ONCE([gl_UCHAR_H],
+[
+ gl_CHECK_NEXT_HEADERS([uchar.h])
+ if test $ac_cv_header_uchar_h = yes; then
+ HAVE_UCHAR_H=1
+ else
+ HAVE_UCHAR_H=0
+ fi
+ AC_SUBST([HAVE_UCHAR_H])
+])
--- /dev/null
+Description:
+A GNU-like <uchar.h>.
+
+Files:
+lib/uchar.in.h
+m4/uchar.m4
+
+Depends-on:
+include_next
+stdint
+wchar
+
+configure.ac:
+gl_UCHAR_H
+
+Makefile.am:
+BUILT_SOURCES += uchar.h
+
+uchar.h: uchar.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
+ -e 's/@''HAVE_UCHAR_H''@/$(HAVE_UCHAR_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_UCHAR_H''@|$(NEXT_UCHAR_H)|g' \
+ < $(srcdir)/uchar.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += uchar.h uchar.h-t
+
+Include:
+<uchar.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all