configure.ac | 14 ++++++++- external/boost/StaticLibrary_boostthread.mk | 20 +++++++++++++ external/boost/UnpackedTarball_boost.mk | 2 + external/boost/clang-cl.patch.0 | 42 ++++++++++++++++++++++++++++ include/rtl/byteseq.h | 6 +++- include/rtl/stringutils.hxx | 3 +- sal/qa/osl/file/osl_old_test_file.cxx | 2 + 7 files changed, 86 insertions(+), 3 deletions(-)
New commits: commit b957190edfc40e1fea99e4781c95aea0bd6fce5e Author: Stephan Bergmann <[email protected]> Date: Thu Nov 12 18:19:11 2015 +0100 Work around clang-cl -FIIntrin.h workaround Change-Id: I71e0de9e13718c1a6cd11339aba740effa2e0476 diff --git a/configure.ac b/configure.ac index 5737d68..58a6ad7 100644 --- a/configure.ac +++ b/configure.ac @@ -3684,7 +3684,19 @@ if test "$_os" = "WINNT"; then dnl localized AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)]) echo "#include <stdlib.h>" > conftest.c - SHOWINCLUDES_PREFIX=`$CC $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \ + dnl Filter out -FIIntrin.h when CC points at clang-cl.exe and needs to + dnl explicitly state that argument: + my_CC= + for i in $CC; do + case $i in + -FIIntrin.h) + ;; + *) + my_CC="$my_CC $i" + ;; + esac + done + SHOWINCLUDES_PREFIX=`$my_CC $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \ grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'` rm -f conftest.c conftest.obj if test -z "$SHOWINCLUDES_PREFIX"; then commit 9b421ef6dee41c33d1a82fc8a8ec6983f13fe2a7 Author: Stephan Bergmann <[email protected]> Date: Thu Nov 12 18:17:51 2015 +0100 external/boost: Adapt to clang-cl Change-Id: Ib07e85bd1a157b6fa78f07a17f8cf5033b01bddf diff --git a/external/boost/StaticLibrary_boostthread.mk b/external/boost/StaticLibrary_boostthread.mk index 77b6ea1..f2498d5 100644 --- a/external/boost/StaticLibrary_boostthread.mk +++ b/external/boost/StaticLibrary_boostthread.mk @@ -18,6 +18,26 @@ $(eval $(call gb_StaticLibrary_add_defs,boostthread,\ -DBOOST_ALL_NO_LIB \ )) +# Lots of the declarations in boost duplicated from windows.h when +# BOOST_USE_WINDOWS_H is not defined (which appears to be the normal case) cause +# warnings or even errors with Clang when windows.h is included too (e.g., +# "conflicting types for 'FileTimeToLocalFileTime'" between +# C:/PROGRA~2/WI3CF2~1/8.1/include/um/fileapi.h and +# workdir/UnpackedTarball/boost/boost/date_time/filetime_functions.hpp), for +# which it appears easies to just define BOOST_USE_WINDOWS_H; also +# -Winvalid-constexpr (e.g., reported from the constexpr definition of lowest() +# in workdir/UnpackedTarball/boost/boost/chrono/duration.hpp, which uses +# std::numeric_limits<>::max() from MSVC's standard library, where nothing is +# marked constexpr) is apparently reported as an error by default: +ifeq ($(OS),WNT) +ifeq ($(COM_IS_CLANG),TRUE) +$(eval $(call gb_StaticLibrary_add_defs,boostthread, \ + -DBOOST_USE_WINDOWS_H \ + -Wno-error=invalid-constexpr \ +)) +endif +endif + $(eval $(call gb_StaticLibrary_use_external,boostthread,boost_headers)) $(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,boostthread,cpp)) diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk index 6beeac1..e52f6cd 100644 --- a/external/boost/UnpackedTarball_boost.mk +++ b/external/boost/UnpackedTarball_boost.mk @@ -85,6 +85,8 @@ boost_patches += boost_1_59_0.multi_array.wshadow.patch # https://svn.boost.org/trac/boost/ticket/11501 boost_patches += boost_1_59_0.property_tree.wreturn-type.patch +boost_patches += clang-cl.patch.0 + $(eval $(call gb_UnpackedTarball_UnpackedTarball,boost)) $(eval $(call gb_UnpackedTarball_set_tarball,boost,$(BOOST_TARBALL))) diff --git a/external/boost/clang-cl.patch.0 b/external/boost/clang-cl.patch.0 new file mode 100644 index 0000000..0dd44d4 --- /dev/null +++ b/external/boost/clang-cl.patch.0 @@ -0,0 +1,42 @@ +--- boost/config/compiler/clang.hpp ++++ boost/config/compiler/clang.hpp +@@ -260,9 +260,7 @@ + + + // Unused attribute: +-#if defined(__GNUC__) && (__GNUC__ >= 4) + # define BOOST_ATTRIBUTE_UNUSED __attribute__((unused)) +-#endif + + #ifndef BOOST_COMPILER + # define BOOST_COMPILER "Clang version " __clang_version__ + +# workdir/UnpackedTarball/boost\boost/smart_ptr/detail/sp_counted_base_clang.hpp(29,1) : error: cannot mangle this C11 atomic type yet +# inline void atomic_increment( atomic_int_least32_t * pw ) +# ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--- boost/smart_ptr/detail/sp_counted_base.hpp ++++ boost/smart_ptr/detail/sp_counted_base.hpp +@@ -21,7 +21,7 @@ + #include <boost/smart_ptr/detail/sp_has_sync.hpp> + + #if defined( __clang__ ) && defined( __has_extension ) +-# if __has_extension( __c_atomic__ ) ++# if __has_extension( __c_atomic__ ) && !defined _MSC_VER + # define BOOST_SP_HAS_CLANG_C11_ATOMICS + # endif + #endif + +# C:/lo64/core/workdir/UnpackedTarball/boost/libs/thread/src/win32/thread.cpp(1006,36) : error: dllimport cannot be applied to non-inline function definition +# BOOST_THREAD_DECL void __cdecl on_process_enter() +# ^ +--- boost/thread/detail/config.hpp ++++ boost/thread/detail/config.hpp +@@ -396,7 +396,7 @@ + #else //Use default + # if defined(BOOST_THREAD_PLATFORM_WIN32) + # if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN) \ +- || defined(__MINGW32__) || defined(MINGW32) || defined(BOOST_MINGW32) ++ || defined(__MINGW32__) || defined(MINGW32) || defined(BOOST_MINGW32) || defined __clang__ + //For compilers supporting auto-tss cleanup + //with Boost.Threads lib, use Boost.Threads lib + # define BOOST_THREAD_USE_LIB commit 5d201bc4909698d276cc4764017b15faa9b5b7be Author: Stephan Bergmann <[email protected]> Date: Thu Nov 12 18:16:17 2015 +0100 Adapt to clang-cl Change-Id: I2f79e52da2aa0ad3a37aac07a36dbe14dfe401a9 diff --git a/include/rtl/stringutils.hxx b/include/rtl/stringutils.hxx index d1b3cc4..c794f49 100644 --- a/include/rtl/stringutils.hxx +++ b/include/rtl/stringutils.hxx @@ -77,7 +77,8 @@ template<char C> struct SAL_WARN_UNUSED OUStringLiteral1_ { "non-ASCII character in OUStringLiteral1"); char const c = C; }; -#if defined _MSC_VER && _MSC_VER <= 1900 // Visual Studio 2015 +#if defined _MSC_VER && _MSC_VER <= 1900 && !defined __clang__ + // Visual Studio 2015 template<char C> using OUStringLiteral1 = OUStringLiteral1_<C>; #pragma warning(disable: 4239) #else commit 8e2f4c7817320354903d9d2c52d59403f37e22b5 Author: Stephan Bergmann <[email protected]> Date: Thu Nov 12 17:20:43 2015 +0100 -Werror,-Wunused-const-variable Change-Id: I3ef314594b64a54aca389816fd9bf5ba0721b397 diff --git a/sal/qa/osl/file/osl_old_test_file.cxx b/sal/qa/osl/file/osl_old_test_file.cxx index 6470832..8444baf 100644 --- a/sal/qa/osl/file/osl_old_test_file.cxx +++ b/sal/qa/osl/file/osl_old_test_file.cxx @@ -52,6 +52,7 @@ public: CPPUNIT_TEST_SUITE_END( ); }; +#ifndef WIN32 const char * const aSource1[] = { "a" , "file:///" TEST_VOLUME "bla/a", @@ -78,6 +79,7 @@ const char * const aSource2[ ] = "../../../a/b/c/d", "file:///" TEST_VOLUME "a/b/c/d", nullptr,nullptr }; +#endif using ::rtl::OUString; using ::rtl::OUStringToOString; commit 2083761d19c91dc875a69f049f53fe91e421a9f0 Author: Stephan Bergmann <[email protected]> Date: Thu Nov 12 16:52:27 2015 +0100 -Werror,-Wmicrosoft-enum-value Change-Id: Iafd6e5f899835303e421be923f70d1e3f42bf65e diff --git a/include/rtl/byteseq.h b/include/rtl/byteseq.h index 27011c2..3c05745 100644 --- a/include/rtl/byteseq.h +++ b/include/rtl/byteseq.h @@ -150,7 +150,11 @@ enum __ByteSequence_NoAcquire /** This enum value can be used to create a bytesequence from a C-Handle without acquiring the handle. */ - BYTESEQ_NOACQUIRE = 0xcafebabe + BYTESEQ_NOACQUIRE = +#if defined _MSC_VER + (int) +#endif + 0xcafebabe }; /** C++ class representing a SAL byte sequence. _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
