[cfe-commits] r139332 - in /cfe/trunk: lib/Headers/limits.h test/Headers/wchar_limits.cpp

Bob Wilson bob.wilson at apple.com
Fri Sep 16 17:31:50 PDT 2011


This is basically just a revert of Sean Hunt's change 135455, but you did not remove the addition of __WCHAR_UNSIGNED__.  That macro is now only used in a test.  If we're not keeping the rest of that change, we should drop the unused macro as well.

Sean, can you clarify what problem you were trying to solve with that change?  The commit message was:

Implement a __WCHAR_UNSIGNED__ macro and use it to include WCHAR_MIN and
WCHAR_MAX in limits.h, thus solving the problem where the system header
thinks it knows better.

On Sep 8, 2011, at 4:25 PM, Eric Christopher wrote:

> Author: echristo
> Date: Thu Sep  8 18:25:25 2011
> New Revision: 139332
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=139332&view=rev
> Log:
> Remove WCHAR_MIN and WCHAR_MAX from limits.h. According to posix and c99
> these should be in stdint.h - and they already are.
> 
> Fixes rdar://10097036.
> 
> Modified:
>    cfe/trunk/lib/Headers/limits.h
>    cfe/trunk/test/Headers/wchar_limits.cpp
> 
> Modified: cfe/trunk/lib/Headers/limits.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/limits.h?rev=139332&r1=139331&r2=139332&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Headers/limits.h (original)
> +++ cfe/trunk/lib/Headers/limits.h Thu Sep  8 18:25:25 2011
> @@ -52,8 +52,6 @@
> #undef  LONG_MIN
> #undef  LONG_MAX
> #undef  ULONG_MAX
> -#undef  WCHAR_MIN
> -#undef  WCHAR_MAX
> 
> #undef  CHAR_BIT
> #undef  CHAR_MIN
> @@ -64,7 +62,6 @@
> #define SHRT_MAX  __SHRT_MAX__
> #define INT_MAX   __INT_MAX__
> #define LONG_MAX  __LONG_MAX__
> -#define WCHAR_MAX __WCHAR_MAX__
> 
> #define SCHAR_MIN (-__SCHAR_MAX__-1)
> #define SHRT_MIN  (-__SHRT_MAX__ -1)
> @@ -90,17 +87,6 @@
> #define CHAR_MAX __SCHAR_MAX__
> #endif
> 
> -/* C++ or C99: Added wchar_t */
> -#if defined(__cplusplus) || __STDC_VERSION__ >= 199901
> -
> -#ifdef __WCHAR_UNSIGNED__
> -#define WCHAR_MIN 0
> -#else
> -#define WCHAR_MIN (-__WCHAR_MAX__-1)
> -#endif
> -
> -#endif
> -
> /* C99 5.2.4.2.1: Added long long. */
> #if __STDC_VERSION__ >= 199901
> 
> 
> Modified: cfe/trunk/test/Headers/wchar_limits.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/wchar_limits.cpp?rev=139332&r1=139331&r2=139332&view=diff
> ==============================================================================
> --- cfe/trunk/test/Headers/wchar_limits.cpp (original)
> +++ cfe/trunk/test/Headers/wchar_limits.cpp Thu Sep  8 18:25:25 2011
> @@ -1,7 +1,7 @@
> // RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify %s
> // RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify -fshort-wchar %s
> 
> -#include <limits.h>
> +#include <stdint.h>
> 
> const bool swchar = (wchar_t)-1 > (wchar_t)0;
> 
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list