[cfe-commits] r63980 - /cfe/trunk/lib/Headers/limits.h

Chris Lattner sabre at nondot.org
Fri Feb 6 15:29:40 PST 2009


Author: lattner
Date: Fri Feb  6 17:29:39 2009
New Revision: 63980

URL: http://llvm.org/viewvc/llvm-project?rev=63980&view=rev
Log:
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!

Modified:
    cfe/trunk/lib/Headers/limits.h

Modified: cfe/trunk/lib/Headers/limits.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/limits.h?rev=63980&r1=63979&r2=63980&view=diff

==============================================================================
--- cfe/trunk/lib/Headers/limits.h (original)
+++ cfe/trunk/lib/Headers/limits.h Fri Feb  6 17:29:39 2009
@@ -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





More information about the cfe-commits mailing list