From 14c25b80e9be5aab9b503a53f810c5bbffe4d632 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Wed, 29 Feb 2012 13:05:08 +0000 Subject: Solaris port. Currently sees around 200 test failures, mostly related to Solaris not providing some of the locales that the test suite uses. Note: This depends on an xlocale (partial) implementation for Solaris and a couple of fixed standard headers. These will be committed to a branch later today. llvm-svn: 151720 --- libcxx/src/locale.cpp | 11 +++++++++++ libcxx/src/random.cpp | 3 +++ libcxx/src/thread.cpp | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'libcxx/src') diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp index ba686588116..089fae6a3ab 100644 --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -7,6 +7,12 @@ // //===----------------------------------------------------------------------===// +// On Solaris, we need to define something to make the C99 parts of localeconv +// visible. +#ifdef __sun__ +#define _LCONV_C99 +#endif + #include "string" #include "locale" #include "codecvt" @@ -925,11 +931,16 @@ ctype::classic_table() _NOEXCEPT return _DefaultRuneLocale.__runetype; #elif defined(__GLIBC__) return __cloc()->__ctype_b; +#elif __sun__ + return __ctype_mask; #elif _WIN32 return _ctype+1; // internal ctype mask table defined in msvcrt.dll // This is assumed to be safe, which is a nonsense assumption because we're // going to end up dereferencing it later... #else + // Platform not supported: abort so the person doing the port knows what to + // fix + abort(); return NULL; #endif } diff --git a/libcxx/src/random.cpp b/libcxx/src/random.cpp index eca97bc8194..6140b74ecb5 100644 --- a/libcxx/src/random.cpp +++ b/libcxx/src/random.cpp @@ -10,6 +10,9 @@ #include "random" #include "system_error" +#ifdef __sun__ +#define rename solaris_headers_are_broken +#endif #include #include #include diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp index cc8c3274be4..f27136a53d0 100644 --- a/libcxx/src/thread.cpp +++ b/libcxx/src/thread.cpp @@ -12,7 +12,7 @@ #include "vector" #include "future" #include -#if !_WIN32 +#if !_WIN32 && !__sun__ #include #endif // _WIN32 -- cgit v1.2.3