aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-06 23:29:39 +0000
committerChris Lattner <sabre@nondot.org>2009-02-06 23:29:39 +0000
commited27d441eba4cac8bd8dfdf4fd6337a7fc1b17d3 (patch)
treedc260beae2210824ef4497c9b695cb71e63ce7bb
parent2a67f7bd99d004f78a961a16b6525f61313dd974 (diff)
only define MB_LEN_MAX if the system <limits.h> 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
-rw-r--r--lib/Headers/limits.h5
1 files changed, 4 insertions, 1 deletions
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