summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-12-07 10:19:24 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-12-07 15:50:05 +0100
commit50cb96346ad54bcdb172acf11b4befe540e2b152 (patch)
tree040135786ecb882c5b8eb457db6a90bd87e141d3
parentf2b70baa6343f8c4ac2b4102a9fe62f79aa7870b (diff)
Use correct __cplusplus value with MSVC
...now that /Zc:__cplusplus is available in Visual Studio 2017 version 15.7 (see <https://blogs.msdn.microsoft.com/vcblog/2018/04/09/ msvc-now-correctly-reports-__cplusplus/>). Some external projects might run into issues when picking up /Zc:__cplusplus directly with $(CXXFLAGS_CXX11) or indirectly via $(gb_CXXFLAGS) now, but that appears not to be the case. Some obsolete MSVC-specific __cplusplus checks can be removed now. (The ones in external/libebook/libebook-msvc.patch.1 pick up /Zc:__cplusplus via $(gb_CXXFLAGS) in external/libebook/ExternalProject_libebook.mk.) Change-Id: Idc6849a0000ea424522f30f61caba112fae25d40 Reviewed-on: https://gerrit.libreoffice.org/64755 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--configure.ac2
-rw-r--r--external/libebook/UnpackedTarball_libebook.mk4
-rw-r--r--external/libebook/libebook-msvc.patch.146
3 files changed, 1 insertions, 51 deletions
diff --git a/configure.ac b/configure.ac
index 44143a0c81a1..04bac9d771ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6208,7 +6208,7 @@ dnl ===================================================================
AC_MSG_CHECKING([whether $CXX supports C++17])
CXXFLAGS_CXX11=
if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
- CXXFLAGS_CXX11=-std:c++17
+ CXXFLAGS_CXX11='-std:c++17 -Zc:__cplusplus'
elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
my_flags='-std=gnu++2a -std=c++2a -std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z'
for flag in $my_flags; do
diff --git a/external/libebook/UnpackedTarball_libebook.mk b/external/libebook/UnpackedTarball_libebook.mk
index 7b6977fe76ab..af2ddea28ae1 100644
--- a/external/libebook/UnpackedTarball_libebook.mk
+++ b/external/libebook/UnpackedTarball_libebook.mk
@@ -15,10 +15,6 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libebook,0))
$(eval $(call gb_UnpackedTarball_update_autoconf_configs,libebook))
-$(eval $(call gb_UnpackedTarball_add_patches,libebook, \
- external/libebook/libebook-msvc.patch.1 \
-))
-
ifeq ($(COM_IS_CLANG),TRUE)
ifneq ($(filter -fsanitize=%,$(CC)),)
$(eval $(call gb_UnpackedTarball_add_patches,libebook, \
diff --git a/external/libebook/libebook-msvc.patch.1 b/external/libebook/libebook-msvc.patch.1
deleted file mode 100644
index d14b122f9575..000000000000
--- a/external/libebook/libebook-msvc.patch.1
+++ /dev/null
@@ -1,46 +0,0 @@
-From 49f6461d4751d3b16e32ab8f9c93a3856b33be49 Mon Sep 17 00:00:00 2001
-From: Miklos Vajna <vmiklos@collabora.co.uk>
-Date: Wed, 2 Aug 2017 14:53:36 +0200
-Subject: [PATCH] m4: MSVC defines __cplusplus as 199711L still
-
-See e.g.
-<https://stackoverflow.com/questions/37503029/cplusplus-is-equal-to-199711-in-msvc-does-it-support-c11>,
-on MSVC we can't depend on the value of __cplusplus, since that one is a
-too low value, even if everything else works fine.
----
- m4/ax_cxx_compile_stdcxx.m4 | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff -Naur a/configure b/configure
---- a/configure 2017-08-02 14:50:09.000000000 +0200
-+++ b/configure 2017-08-02 14:50:57.000000000 +0200
-@@ -16001,7 +16001,7 @@
-
- #error "This is not a C++ compiler"
-
--#elif __cplusplus < 201103L
-+#elif __cplusplus < 201103L && !(defined _MSC_VER)
-
- #error "This is not a C++11 compiler"
-
-@@ -16314,7 +16314,7 @@
-
- #error "This is not a C++ compiler"
-
--#elif __cplusplus < 201103L
-+#elif __cplusplus < 201103L && !(defined _MSC_VER)
-
- #error "This is not a C++11 compiler"
-
-@@ -16636,7 +16636,7 @@
-
- #error "This is not a C++ compiler"
-
--#elif __cplusplus < 201103L
-+#elif __cplusplus < 201103L && !(defined _MSC_VER)
-
- #error "This is not a C++11 compiler"
-
---
-2.12.3
-