summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorEd Schouten <ed@80386.nl>2013-09-29 07:54:52 +0000
committerEd Schouten <ed@80386.nl>2013-09-29 07:54:52 +0000
commitd062146896ffa711c1f413b002d964eae4c30e4a (patch)
treefc473badf0821e6f6b2c99ebcf5bb17db580d587 /clang/lib/Basic/Targets.cpp
parente75666f47a9aed06c6e82dc009575ad10e68a8c0 (diff)
downloadbcm5719-llvm-d062146896ffa711c1f413b002d964eae4c30e4a.tar.gz
bcm5719-llvm-d062146896ffa711c1f413b002d964eae4c30e4a.zip
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
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index f1a14544104..3ee9cd48b53 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -253,6 +253,11 @@ protected:
Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
DefineStd(Builder, "unix", Opts);
Builder.defineMacro("__ELF__");
+
+ // On FreeBSD, wchar_t contains the number of the code point as
+ // used by the character set of the locale. These character sets are
+ // not necessarily a superset of ASCII.
+ Builder.defineMacro("__STDC_MB_MIGHT_NEQ_WC__", "1");
}
public:
FreeBSDTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
OpenPOWER on IntegriCloud