desktop/source/app/sofficemain.cxx | 3 +++ filter/Library_svgfilter.mk | 7 +++++++ sc/Library_sc.mk | 7 +++++++ sdext/Library_pdfimport.mk | 6 ++++++ solenv/gbuild/platform/com_MSC_defs.mk | 3 +++ 5 files changed, 26 insertions(+)
New commits: commit 61c88ae6945c241f5f2aeb844eeca0776b487132 Author: Michael Stahl <mst...@redhat.com> Date: Fri Jan 19 21:23:51 2018 +0100 gbuild: always compile as C++17 with MSVC 2017 The current update MSVC 2017.5 supports fancy new C++ features, but unfortunately in its default C++14 mode it falls over and dies with an internal compiler error as soon as it sees the WeakImplHelper variadic template. In order to work around the ICE, build everything as C++17, which somehow doesn't crash. This causes loads of deprecation warnings about obsolete std::this and badly designed std::that, almost all of them from boost headers, which are well known for following every best practice in the C++ book. Liberally sprinkle macros around to suppress the warnings for now, like we already do with the other million warnings from boost headers. Change-Id: Ia6b6ef5e457b5fe3c8cfe361ba5da39376bb7c4c Reviewed-on: https://gerrit.libreoffice.org/48225 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index 657614962489..e27b48d8b93a 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -92,6 +92,9 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id, std::string ini_path = CrashReporter::getIniFileName(); std::ofstream minidump_file(ini_path, std::ios_base::app); // TODO: moggi: can we avoid this conversion +#ifdef _MSC_VER +#pragma warning (disable: 4996) +#endif std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1; std::string aPath = conv1.to_bytes(std::wstring(path)) + conv1.to_bytes(std::wstring(id)) + ".dmp"; minidump_file << "DumpFile=" << aPath << "\n"; diff --git a/filter/Library_svgfilter.mk b/filter/Library_svgfilter.mk index b8e52c73d9fe..e0d8ff37ccce 100644 --- a/filter/Library_svgfilter.mk +++ b/filter/Library_svgfilter.mk @@ -29,6 +29,13 @@ $(eval $(call gb_Library_add_defs,svgfilter,\ -DFILTER_DLLIMPLEMENTATION \ )) +ifeq ($(COM),MSC) +$(eval $(call gb_Library_add_defs,svgfilter,\ + -D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING \ + -D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING \ +)) +endif + $(eval $(call gb_Library_set_include,svgfilter,\ $$(INCLUDE) \ -I$(SRCDIR)/filter/inc \ diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 9e1432c0a8c3..9d04c29f0d3f 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -29,6 +29,13 @@ $(eval $(call gb_Library_add_defs,sc,\ -DSC_INFO_OSVERSION=\"$(OS)\" \ )) +# there is an odd case of this about std::function in dataproviderdlg.cxx that resists more localised suppression +ifeq ($(COM),MSC) +$(eval $(call gb_Library_add_cxxflags,sc,\ + -wd4121 \ +)) +endif + $(eval $(call gb_Library_use_custom_headers,sc,\ officecfg/registry \ )) diff --git a/sdext/Library_pdfimport.mk b/sdext/Library_pdfimport.mk index 854f00c49248..7c11d36e42ba 100644 --- a/sdext/Library_pdfimport.mk +++ b/sdext/Library_pdfimport.mk @@ -35,6 +35,12 @@ $(eval $(call gb_Library_use_externals,pdfimport,\ $(if $(filter-out WNT MACOSX,$(OS)),fontconfig) \ )) +ifeq ($(COM),MSC) +$(eval $(call gb_Library_add_defs,pdfimport, \ + -D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING \ +)) +endif + $(eval $(call gb_Library_add_defs,pdfimport, \ -DBOOST_SPIRIT_USE_OLD_NAMESPACE \ -DBOOST_ALL_NO_LIB \ diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk index 507264e1db89..b276f2d5329e 100644 --- a/solenv/gbuild/platform/com_MSC_defs.mk +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -47,6 +47,8 @@ gb_COMPILERDEFS := \ -DBOOST_ERROR_CODE_HEADER_ONLY \ -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE \ -DBOOST_SYSTEM_NO_DEPRECATED \ + -D_HAS_AUTO_PTR_ETC \ + -D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING \ -D_CRT_NON_CONFORMING_SWPRINTFS \ -D_CRT_NONSTDC_NO_DEPRECATE \ -D_CRT_SECURE_NO_DEPRECATE \ @@ -163,6 +165,7 @@ endif gb_CXXFLAGS := \ -utf-8 \ + $(if $(filter-out 140,$(VCVER)),-std:c++17) \ -Gd \ -GR \ -Gs \ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits