Add character set related __STDC_* definitions.
Clang uses UTF-16 and UTF-32 for its char16_t's and char32_t's exclusively. This means that we can define __STDC_UTF_16__ and __STDC_UTF_32__ unconditionally. While there, define __STDC_MB_MIGHT_NEQ_WC__ for FreeBSD. FreeBSD's wchar_t's don't encode characters as ISO-10646; the encoding depends on the locale used. Because the character set used might not be a superset of ASCII, we must define __STDC_MB_MIGHT_NEQ_WC__. llvm-svn: 191631
This commit is contained in:
@@ -330,6 +330,14 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
|
||||
Builder.defineMacro("__cplusplus", "199711L");
|
||||
}
|
||||
|
||||
// In C11 these are environment macros. In C++11 they are only defined
|
||||
// as part of <cuchar>. To prevent breakage when mixing C and C++
|
||||
// code, define these macros unconditionally. We can define them
|
||||
// unconditionally, as Clang always uses UTF-16 and UTF-32 for 16-bit
|
||||
// and 32-bit character literals.
|
||||
Builder.defineMacro("__STDC_UTF_16__", "1");
|
||||
Builder.defineMacro("__STDC_UTF_32__", "1");
|
||||
|
||||
if (LangOpts.ObjC1)
|
||||
Builder.defineMacro("__OBJC__");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user