X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=includes%2Flimits.h;h=79fc6f607ae81a4bfd4c25399ef1869c29eac530;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hp=5eeaf1017a8ca878565eac1a1f7cb1becb75180d;hpb=b08f4b52b1cd1f7a9553c0f357a7c90859fa3e73;p=pdclib diff --git a/includes/limits.h b/includes/limits.h index 5eeaf10..79fc6f6 100644 --- a/includes/limits.h +++ b/includes/limits.h @@ -1,6 +1,4 @@ -/* $Id$ */ - -/* 7.10 Sizes of integer types +/* Sizes of integer types This file is part of the Public Domain C Library (PDCLib). Permission is granted to use, modify, and / or redistribute at will. @@ -8,14 +6,15 @@ #ifndef _PDCLIB_LIMITS_H #define _PDCLIB_LIMITS_H _PDCLIB_LIMITS_H +#include "_PDCLIB_int.h" -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H -#include <_PDCLIB_int.h> -#endif - -/* 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 @@ -38,4 +37,3 @@ #define ULONG_MAX _PDCLIB_ULONG_MAX #endif -