From 6cb69ffa0a86c7c41d357a6e0dcb05c72308dd6b Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Tue, 25 Nov 2014 21:57:41 +0000 Subject: [PATCH] Fixes to get libc++ building on sun solaris. Patch from C Bergstrom. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222794 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/__config | 2 ++ include/__locale | 4 +++- include/support/solaris/xlocale.h | 2 ++ include/tuple | 4 ++-- lib/CMakeLists.txt | 3 +++ src/support/solaris/xlocale.c | 2 +- 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/__config b/include/__config index d34bb7cc..e1e23594 100644 --- a/include/__config +++ b/include/__config @@ -644,6 +644,8 @@ template struct __static_assert_check {}; #define _LIBCPP_ELAST __ELASTERROR #elif defined(__APPLE__) // Not _LIBCPP_ELAST needed on Apple +#elif defined(__sun__) +#define _LIBCPP_ELAST ESTALE #else // Warn here so that the person doing the libcxx port has an easier time: #warning This platform's ELAST hasn't been ported yet diff --git a/include/__locale b/include/__locale index 5ccd795b..47116200 100644 --- a/include/__locale +++ b/include/__locale @@ -29,8 +29,10 @@ # if __ANDROID_API__ <= 20 # include # endif +#elif defined(__sun__) +# include #elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ - || defined(__sun__) || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) + || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) # include #endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__ diff --git a/include/support/solaris/xlocale.h b/include/support/solaris/xlocale.h index 875a39ad..6b5b544d 100644 --- a/include/support/solaris/xlocale.h +++ b/include/support/solaris/xlocale.h @@ -14,6 +14,8 @@ #ifndef __XLOCALE_H_INCLUDED #define __XLOCALE_H_INCLUDED +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/include/tuple b/include/tuple index aa7185c8..5fc27f98 100644 --- a/include/tuple +++ b/include/tuple @@ -376,9 +376,9 @@ template _LIBCPP_INLINE_VISIBILITY void __swallow(_Tp&&...) _NOEXCEPT {} -template +template struct __all - : is_same<__all<_B...>, __all<(_B, true)...>> + : is_same<__all<_Pred...>, __all<(_Pred, true)...>> { }; template diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 318c4ce6..12e9f4ad 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -3,6 +3,9 @@ file(GLOB LIBCXX_SOURCES ../src/*.cpp) if(WIN32) file(GLOB LIBCXX_WIN32_SOURCES ../src/support/win32/*.cpp) list(APPEND LIBCXX_SOURCES ${LIBCXX_WIN32_SOURCES}) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS") + file(GLOB LIBCXX_SOLARIS_SOURCES ../src/support/solaris/*.c) + list(APPEND LIBCXX_SOURCES ${LIBCXX_SOLARIS_SOURCES}) endif() # Add all the headers to the project for IDEs. diff --git a/src/support/solaris/xlocale.c b/src/support/solaris/xlocale.c index 39dd8e36..81750a8b 100644 --- a/src/support/solaris/xlocale.c +++ b/src/support/solaris/xlocale.c @@ -17,7 +17,7 @@ #include #include #include -#include "xlocale.h" +#include "support/solaris/xlocale.h" static _LC_locale_t *__C_locale;