* doc/posix-headers/limits.texi: Document the issue.
* lib/limits.in.h (MB_LEN_MAX): New macro, if not already defined.
* m4/limits-h.m4 (gl_LIMITS_H): Test for MB_LEN_MAX.
* tests/test-limits-h.c: Check that it’s positive.
+2023-05-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ limits-h: port to pcc
+ * doc/posix-headers/limits.texi: Document the issue.
+ * lib/limits.in.h (MB_LEN_MAX): New macro, if not already defined.
+ * m4/limits-h.m4 (gl_LIMITS_H): Test for MB_LEN_MAX.
+ * tests/test-limits-h.c: Check that it’s positive.
+
2023-04-28 Paul Eggert <eggert@cs.ucla.edu>
year2038-recommended: new module
defined on some platforms:
older glibc systems (e.g. Fedora 1), AIX 5.1, HP-UX 11, IRIX 6.5, OpenVMS.
@item
+The macro @code{MB_LEN_MAX} is not defined on some platforms:
+pcc 1.2.0.DEVEL 20220331.
+@item
The macros @code{WORD_BIT}, @code{LONG_BIT} are not defined on some platforms:
glibc 2.11 without @code{-D_GNU_SOURCE}, Cygwin, mingw, MSVC 14.
@item
# endif
#endif
+/* Assume no multibyte character is longer than 16 bytes. */
+#ifndef MB_LEN_MAX
+# define MB_LEN_MAX 16
+#endif
+
/* Macros specified by C23 and by ISO/IEC TS 18661-1:2014. */
#if (! defined ULLONG_WIDTH \
int ullw = ULLONG_WIDTH;
int bw = BOOL_WIDTH;
int bm = BOOL_MAX;
+ int mblm = MB_LEN_MAX;
]])],
[gl_cv_header_limits_width=yes],
[gl_cv_header_limits_width=no])])
int bool_attrs[] = { BOOL_MAX, BOOL_WIDTH };
static_assert (BOOL_MAX == (((1U << (BOOL_WIDTH - 1)) - 1) * 2) + 1);
+static_assert (0 < MB_LEN_MAX);
+
int
main (void)
{