cppu/qa/test_unotype.cxx | 60 --------------------------------- external/curl/ExternalProject_curl.mk | 2 - external/icu/UnpackedTarball_icu.mk | 1 external/icu/icu4c-wchar_t.patch | 16 -------- include/cppu/unotype.hxx | 6 +-- onlineupdate/Executable_updater.mk | 6 --- solenv/gbuild/platform/com_MSC_defs.mk | 2 - solenv/gcc-wrappers/wrapper.cxx | 1 8 files changed, 3 insertions(+), 91 deletions(-)
New commits: commit e16fa715c43dcdf836ce8c400b6d54eae87b627d Author: David Ostrovsky <da...@ostrovsky.org> Date: Sun Mar 13 09:18:00 2016 +0100 Handle wchar_t as native C++11 type on windows The option /Zc:wchar_t- prevented to use wchar_t as a built-in type according to the C++ standard. In Visual C++ 6.0 and earlier, wchar_t was not implemented as a built-in type, but was declared in wchar.h as a typedef for unsigned short. Now, years later after the end of life this outdated toolchain, there is no reason not to use native type. The only issue could be the ABI compatibility. But on a quick look at least, it looks like none of the mangled C++ symbols in the stable URE interface actually depend on wchar_t. We forgot to get rid of /Zc:wchar_t- in 5.1. Do that for LibreOffice 5.2, though. Change-Id: I8d6b380660859efa44c83c830734978d31d756a0 Reviewed-on: https://gerrit.libreoffice.org/22589 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/cppu/qa/test_unotype.cxx b/cppu/qa/test_unotype.cxx index 0f2beb0..bbaaac7 100644 --- a/cppu/qa/test_unotype.cxx +++ b/cppu/qa/test_unotype.cxx @@ -235,12 +235,7 @@ void Test::testUnoType() { } void Test::testGetTypeFavourUnsigned() { -#if defined SAL_W32 && !defined __MINGW32__ && !defined __clang__ - // cf. sal/types.h sal_Unicode - CPPUNIT_ASSERT(typeid(sal_Unicode) == typeid(sal_uInt16)); -#else CPPUNIT_ASSERT(typeid(sal_Unicode) != typeid(sal_uInt16)); -#endif CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourUnsigned(static_cast<cppu::UnoVoidType *>(nullptr)), cppu::UnoType<cppu::UnoVoidType>::get()); @@ -284,16 +279,9 @@ void Test::testGetTypeFavourUnsigned() { CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourUnsigned(static_cast<cppu::UnoCharType *>(nullptr)), cppu::UnoType<cppu::UnoCharType>::get()); -#if defined SAL_W32 && !defined __MINGW32__ && !defined __clang__ - // cf. sal/types.h sal_Unicode - CPPUNIT_ASSERT_EQUAL( - cppu::getTypeFavourUnsigned(static_cast<sal_Unicode *>(nullptr)), - cppu::UnoType<cppu::UnoUnsignedShortType>::get()); -#else CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourUnsigned(static_cast<sal_Unicode *>(nullptr)), cppu::UnoType<cppu::UnoCharType>::get()); -#endif CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourUnsigned(static_cast<OUString *>(nullptr)), cppu::UnoType<OUString>::get()); @@ -330,22 +318,6 @@ void Test::testGetTypeFavourUnsigned() { cppu::UnoType< cppu::UnoSequenceType< cppu::UnoSequenceType<cppu::UnoUnsignedShortType>>>::get()); -#if defined SAL_W32 && !defined __MINGW32__ && !defined __clang__ - // cf. sal/types.h sal_Unicode - CPPUNIT_ASSERT_EQUAL( - cppu::getTypeFavourUnsigned( - static_cast<css::uno::Sequence<sal_Unicode> *>(nullptr)), - cppu::UnoType< - cppu::UnoSequenceType<cppu::UnoUnsignedShortType>>::get()); - CPPUNIT_ASSERT_EQUAL( - cppu::getTypeFavourUnsigned( - static_cast< - css::uno::Sequence< - css::uno::Sequence<sal_Unicode>> *>(nullptr)), - cppu::UnoType< - cppu::UnoSequenceType< - cppu::UnoSequenceType<cppu::UnoUnsignedShortType>>>::get()); -#else CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourUnsigned( static_cast<css::uno::Sequence<sal_Unicode> *>(nullptr)), @@ -358,7 +330,6 @@ void Test::testGetTypeFavourUnsigned() { cppu::UnoType< cppu::UnoSequenceType< cppu::UnoSequenceType<cppu::UnoCharType>>>::get()); -#endif CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourUnsigned( static_cast<css::uno::TypeClass *>(nullptr)), @@ -429,12 +400,7 @@ void Test::testGetTypeFavourUnsigned() { } void Test::testGetTypeFavourChar() { -#if defined SAL_W32 && !defined __MINGW32__ && !defined __clang__ - // cf. sal/types.h sal_Unicode - CPPUNIT_ASSERT(typeid(sal_Unicode) == typeid(sal_uInt16)); -#else CPPUNIT_ASSERT(typeid(sal_Unicode) != typeid(sal_uInt16)); -#endif CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourChar(static_cast<cppu::UnoVoidType *>(nullptr)), cppu::UnoType<cppu::UnoVoidType>::get()); @@ -454,16 +420,9 @@ void Test::testGetTypeFavourChar() { cppu::getTypeFavourChar( static_cast<cppu::UnoUnsignedShortType *>(nullptr)), cppu::UnoType<cppu::UnoUnsignedShortType>::get()); -#if defined SAL_W32 && !defined __MINGW32__ && !defined __clang__ - // cf. sal/types.h sal_Unicode - CPPUNIT_ASSERT_EQUAL( - cppu::getTypeFavourChar(static_cast<sal_uInt16 *>(nullptr)), - cppu::UnoType<cppu::UnoCharType>::get()); -#else CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourChar(static_cast<sal_uInt16 *>(nullptr)), cppu::UnoType<cppu::UnoUnsignedShortType>::get()); -#endif CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourChar(static_cast<sal_Int32 *>(nullptr)), cppu::UnoType<sal_Int32>::get()); @@ -503,19 +462,11 @@ void Test::testGetTypeFavourChar() { cppu::UnoSequenceType<cppu::UnoUnsignedShortType> *>(nullptr)), cppu::UnoType< cppu::UnoSequenceType<cppu::UnoUnsignedShortType>>::get()); -#if defined SAL_W32 && !defined __MINGW32__ && !defined __clang__ - // cf. sal/types.h sal_Unicode - CPPUNIT_ASSERT_EQUAL( - cppu::getTypeFavourChar( - static_cast<css::uno::Sequence<sal_uInt16> *>(nullptr)), - cppu::UnoType<cppu::UnoSequenceType<cppu::UnoCharType>>::get()); -#else CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourChar( static_cast<css::uno::Sequence<sal_uInt16> *>(nullptr)), cppu::UnoType< cppu::UnoSequenceType<cppu::UnoUnsignedShortType>>::get()); -#endif CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourChar( static_cast< @@ -525,16 +476,6 @@ void Test::testGetTypeFavourChar() { cppu::UnoType< cppu::UnoSequenceType< cppu::UnoSequenceType<cppu::UnoUnsignedShortType>>>::get()); -#if defined SAL_W32 && !defined __MINGW32__ && !defined __clang__ - // cf. sal/types.h sal_Unicode - CPPUNIT_ASSERT_EQUAL( - cppu::getTypeFavourChar( - static_cast< - css::uno::Sequence<css::uno::Sequence<sal_uInt16>> *>(nullptr)), - cppu::UnoType< - cppu::UnoSequenceType< - cppu::UnoSequenceType<cppu::UnoCharType>>>::get()); -#else CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourChar( static_cast< @@ -542,7 +483,6 @@ void Test::testGetTypeFavourChar() { cppu::UnoType< cppu::UnoSequenceType< cppu::UnoSequenceType<cppu::UnoUnsignedShortType>>>::get()); -#endif CPPUNIT_ASSERT_EQUAL( cppu::getTypeFavourChar( static_cast<css::uno::Sequence<sal_Unicode> *>(nullptr)), diff --git a/external/curl/ExternalProject_curl.mk b/external/curl/ExternalProject_curl.mk index 9dd4a07..db33396 100644 --- a/external/curl/ExternalProject_curl.mk +++ b/external/curl/ExternalProject_curl.mk @@ -81,7 +81,7 @@ $(call gb_ExternalProject_get_state_target,curl,build): $(call gb_ExternalProject_run,build,\ MAKEFLAGS= LIB="$(ILIB)" nmake -f Makefile.vc10 \ cfg=$(if $(MSVC_USE_DEBUG_RUNTIME),debug-dll,release-dll) \ - EXCFLAGS="/EHa /Zc:wchar_t- /D_CRT_SECURE_NO_DEPRECATE /DUSE_WINDOWS_SSPI $(SOLARINC)" $(if $(filter X86_64,$(CPUNAME)),MACHINE=X64) \ + EXCFLAGS="/EHa /D_CRT_SECURE_NO_DEPRECATE /DUSE_WINDOWS_SSPI $(SOLARINC)" $(if $(filter X86_64,$(CPUNAME)),MACHINE=X64) \ ,lib) endif diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk index 4a6a114..0e4a645 100644 --- a/external/icu/UnpackedTarball_icu.mk +++ b/external/icu/UnpackedTarball_icu.mk @@ -14,7 +14,6 @@ $(eval $(call gb_UnpackedTarball_set_tarball,icu,$(ICU_TARBALL))) $(eval $(call gb_UnpackedTarball_add_patches,icu,\ external/icu/icu4c-build.patch \ external/icu/icu4c-aix.patch \ - external/icu/icu4c-wchar_t.patch \ external/icu/icu4c-warnings.patch \ external/icu/icu4c-macosx.patch \ external/icu/icu4c-solarisgcc.patch \ diff --git a/external/icu/icu4c-wchar_t.patch b/external/icu/icu4c-wchar_t.patch deleted file mode 100644 index 4a8067c..0000000 --- a/external/icu/icu4c-wchar_t.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- misc/icu/source/config/mh-cygwin-msvc -+++ misc/build/icu/source/config/mh-cygwin-msvc -@@ -43,10 +43,9 @@ - - # /GF pools strings and places them into read-only memory - # /EHsc enables exception handling --# /Zc:wchar_t makes wchar_t a native type. Required for C++ ABI compatibility. - # -D_CRT_SECURE_NO_DEPRECATE is needed to quiet warnings about using standard C functions. --CFLAGS+=-GF -nologo --CXXFLAGS+=-GF -nologo -EHsc -Zc:wchar_t -+CFLAGS+=-GF -nologo -Zc:wchar_t- -+CXXFLAGS+=-GF -nologo -EHsc -Zc:wchar_t- - CPPFLAGS+=-D_CRT_SECURE_NO_DEPRECATE - DEFS+=-DWIN32 -DCYGWINMSVC - LDFLAGS+=-nologo - diff --git a/include/cppu/unotype.hxx b/include/cppu/unotype.hxx index a4d7501..a9bcc27 100644 --- a/include/cppu/unotype.hxx +++ b/include/cppu/unotype.hxx @@ -149,8 +149,7 @@ cppu_detail_getUnoType( ::typelib_TypeClass_UNSIGNED_SHORT); } -#if LIBO_INTERNAL_ONLY \ - && (!defined SAL_W32 || defined __MINGW32__ || defined __clang__) +#if LIBO_INTERNAL_ONLY // cf. sal/types.h sal_Unicode inline css::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER sal_uInt16 const *) { @@ -195,8 +194,7 @@ cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ::cppu::UnoCharType const *) { return ::cppu::detail::getTypeFromTypeClass(::typelib_TypeClass_CHAR); } -#if LIBO_INTERNAL_ONLY \ - && (!defined SAL_W32 || defined __MINGW32__ || defined __clang__) +#if LIBO_INTERNAL_ONLY // cf. sal/types.h sal_Unicode inline css::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER sal_Unicode const *) { diff --git a/onlineupdate/Executable_updater.mk b/onlineupdate/Executable_updater.mk index fba7e3c..7420f1f 100644 --- a/onlineupdate/Executable_updater.mk +++ b/onlineupdate/Executable_updater.mk @@ -36,12 +36,6 @@ $(eval $(call gb_Executable_add_libs,updater,\ )) endif -ifeq ($(OS),WNT) -$(eval $(call gb_Executable_add_cxxflags,updater,\ - /Zc:wchar_t \ -)) -endif - $(eval $(call gb_Executable_use_externals,updater,\ gtk \ bzip2 \ diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk index 951d859..a4c801f 100644 --- a/solenv/gbuild/platform/com_MSC_defs.mk +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -166,7 +166,6 @@ gb_CFLAGS := \ -wd4626 \ -wd4706 \ -wd4800 \ - -Zc:wchar_t- \ ifeq ($(COM_IS_CLANG),TRUE) gb_CFLAGS += \ @@ -214,7 +213,6 @@ gb_CXXFLAGS := \ -wd4706 \ -wd4800 \ -wd4913 \ - -Zc:wchar_t- \ ifeq ($(CPUNAME),X86_64) diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx index 0ed323c..cc57698 100644 --- a/solenv/gcc-wrappers/wrapper.cxx +++ b/solenv/gcc-wrappers/wrapper.cxx @@ -89,7 +89,6 @@ string processccargs(vector<string> rawargs) { else args.append(" -MD"); args.append(" -Gy"); - args.append(" -Zc:wchar_t-"); args.append(" -Ob1 -Oxs -Oy-"); // apparently these must be at the end _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits