diff options
| author | Ed Schouten <ed@80386.nl> | 2013-09-29 07:54:52 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@80386.nl> | 2013-09-29 07:54:52 +0000 |
| commit | d062146896ffa711c1f413b002d964eae4c30e4a (patch) | |
| tree | fc473badf0821e6f6b2c99ebcf5bb17db580d587 /clang/lib/Basic/Targets.cpp | |
| parent | e75666f47a9aed06c6e82dc009575ad10e68a8c0 (diff) | |
| download | bcm5719-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.cpp | 5 |
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) { |

