From: Chris Lattner Date: Fri, 6 Feb 2009 23:29:39 +0000 (+0000) Subject: only define MB_LEN_MAX if the system doesn't. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed27d441eba4cac8bd8dfdf4fd6337a7fc1b17d3;p=clang only define MB_LEN_MAX if the system doesn't. don't typecast CHAR_MIN to char, this makes it not a PP constant and gives it the wrong unpromoted type. Thanks to Sebastian for pointing this out! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63980 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/limits.h b/lib/Headers/limits.h index 62dd6a5cd0..2e0deaff52 100644 --- a/lib/Headers/limits.h +++ b/lib/Headers/limits.h @@ -64,11 +64,14 @@ #define UINT_MAX (__INT_MAX__ *2U +1U) #define ULONG_MAX (__LONG_MAX__ *2UL+1UL) +#ifndef MB_LEN_MAX #define MB_LEN_MAX 1 +#endif + #define CHAR_BIT __CHAR_BIT__ #ifdef __CHAR_UNSIGNED__ /* -funsigned-char */ -#define CHAR_MIN ((char)0) +#define CHAR_MIN 0 #define CHAR_MAX UCHAR_MAX #else #define CHAR_MIN SCHAR_MIN