]> pd.if.org Git - pdclib/blobdiff - includes/limits.h
Sweeping cleanups. Sorry for the massive commit; I got sidetracked once too often.
[pdclib] / includes / limits.h
index c81ddece55723d928c9566b35b0d5c49bc90830b..e3057051ce87f926b97c50a9fc2ad0dec8492b7c 100644 (file)
@@ -1,4 +1,4 @@
-/* 7.10 Sizes of integer types <limits.h>
+/* Sizes of integer types <limits.h>
 
    This file is part of the Public Domain C Library (PDCLib).
    Permission is granted to use, modify, and / or redistribute at will.
@@ -8,8 +8,13 @@
 #define _PDCLIB_LIMITS_H _PDCLIB_LIMITS_H
 #include <_PDCLIB_int.h>
 
-/* TODO: Defined to 1 as multibyte characters are not supported yet. */
-#define MB_LEN_MAX 1
+/* MSVC 2010 defines this to 5, which is enough for UTF-8 but might rule out
+   stateful encodings (like ISO/IEC 2022). GCC 5.3 defines this to 16, which
+   is meant to ensure future compatibility. For the same reason, we go along
+   with GCC's definition.
+   http://lists.gnu.org/archive/html/bug-gnulib/2015-05/msg00001.html
+*/
+#define MB_LEN_MAX 16
 
 #define LLONG_MIN  _PDCLIB_LLONG_MIN
 #define LLONG_MAX  _PDCLIB_LLONG_MAX
@@ -32,4 +37,3 @@
 #define ULONG_MAX  _PDCLIB_ULONG_MAX
 
 #endif
-