From ef634ecddde9dc73db8c2ff74cc937c03b020c2d Mon Sep 17 00:00:00 2001 From: Michal Gorny Date: Tue, 18 Oct 2016 16:54:59 +0000 Subject: [PATCH] [solaris] Convert the support library to C++ to fix -std=c++11 build Convert the Solaris xlocale.c compatibility library from plain C to C++ in order to fix the build failures caused by the addition of -std=c++11 to LIBCXX_COMPILE_FLAGS. The additional flag got propagated to the C file, resulting in error with strict compilers. Differential Revision: https://reviews.llvm.org/D25431 llvm-svn: 284494 --- libcxx/lib/CMakeLists.txt | 2 +- libcxx/src/support/solaris/{xlocale.c => xlocale.cpp} | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) rename libcxx/src/support/solaris/{xlocale.c => xlocale.cpp} (98%) diff --git a/libcxx/lib/CMakeLists.txt b/libcxx/lib/CMakeLists.txt index ea703f5..1e7c6d4 100644 --- a/libcxx/lib/CMakeLists.txt +++ b/libcxx/lib/CMakeLists.txt @@ -6,7 +6,7 @@ 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) + file(GLOB LIBCXX_SOLARIS_SOURCES ../src/support/solaris/*.cpp) list(APPEND LIBCXX_SOURCES ${LIBCXX_SOLARIS_SOURCES}) endif() diff --git a/libcxx/src/support/solaris/xlocale.c b/libcxx/src/support/solaris/xlocale.cpp similarity index 98% rename from libcxx/src/support/solaris/xlocale.c rename to libcxx/src/support/solaris/xlocale.cpp index 802829c..6eaf317 100644 --- a/libcxx/src/support/solaris/xlocale.c +++ b/libcxx/src/support/solaris/xlocale.cpp @@ -14,6 +14,7 @@ #include #include +extern "C" { int isxdigit_l(int __c, locale_t __l) { return isxdigit(__c); @@ -63,4 +64,6 @@ struct lconv *localeconv_l(locale_t __l) { return localeconv(); } +}; + #endif // __sun__ -- 2.7.4