diff options
author | Sean Hunt <scshunt@csclub.uwaterloo.ca> | 2011-07-19 00:50:57 +0000 |
---|---|---|
committer | Sean Hunt <scshunt@csclub.uwaterloo.ca> | 2011-07-19 00:50:57 +0000 |
commit | 2f5127e6e0dbd9fcead5d61576d4c40237a28927 (patch) | |
tree | df43e7acdb674c9adf8a18500a32b9ffd2a57cdf /lib/Frontend | |
parent | b5fd253af366cae059f7e2f0db8a261076e39e81 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/InitPreprocessor.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 9428cd5de0..77a1b3f396 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -554,6 +554,9 @@ static void InitializePredefinedMacros(const TargetInfo &TI, if (!TargetInfo::isTypeSigned(TI.getWIntType())) Builder.defineMacro("__WINT_UNSIGNED__"); + if (!TargetInfo::isTypeSigned(TI.getWCharType())) + Builder.defineMacro("__WCHAR_UNSIGNED__"); + // Define exact-width integer types for stdint.h Builder.defineMacro("__INT" + llvm::Twine(TI.getCharWidth()) + "_TYPE__", "char"); |