summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-10-12 14:13:25 +0200
committerStephan Bergmann <sbergman@redhat.com>2023-10-12 18:51:08 +0200
commit3c6de7e20e35e37cbddd2d35e065525616deac00 (patch)
tree15ceac5af46c91b6f83df3f240ce652ddb980f71
parent5b9249e950165015ba57cc2c0503381df9751bf6 (diff)
Fix build against VS 2022 17.7.5
After af9c3ed6f748781f2a77e676ffe740992788969b "__cpp_char8_t is generally available now" (which Jenkins built successfully against some VS 2019 version), various people using at least exactly VS 2022 17.7.5 (--with-visual-studio=2022) started to experience issues like > include\rtl/stringutils.hxx(251): error C2065: 'char8_t': undeclared identifier when compiling e.g. cli_ure/source/climaker/climaker_app.cxx (i.e., in /clr mode). This is similar to the VS 2019 16.11.30 /clr issue discussed in the commit message of 5a40abc86b94c0be5b4a252c6ab5b0b0df6e520d "Drop some newly obsolete __cplusplus version checks", just that it apparently hits with a different set of VS versions. The fix here is similar to the fix there, just conditionally disable char8_t functionality for certain VS versions in /clr mode, and keep fingers crossed. Change-Id: I8c4ed2e3d290dc1c94f329d314407a56170564f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157866 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--include/rtl/strbuf.hxx2
-rw-r--r--include/rtl/string.hxx2
-rw-r--r--include/rtl/stringutils.hxx2
-rw-r--r--include/rtl/ustrbuf.hxx2
4 files changed, 7 insertions, 1 deletions
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index bb7f72e78cb5..dd4187e30fc3 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -122,7 +122,9 @@ public:
explicit OStringBuffer(bool) = delete;
explicit OStringBuffer(char) = delete;
explicit OStringBuffer(wchar_t) = delete;
+#if !(defined _MSC_VER && _MSC_VER == 1937 && defined _MANAGED)
explicit OStringBuffer(char8_t) = delete;
+#endif
explicit OStringBuffer(char16_t) = delete;
explicit OStringBuffer(char32_t) = delete;
#endif
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index a9038fc3cef0..566ff7ff4d2c 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -104,6 +104,7 @@ public:
}
}
+#if !(defined _MSC_VER && _MSC_VER == 1937 && defined _MANAGED)
#if HAVE_CPP_CONSTEVAL
consteval
#else
@@ -117,6 +118,7 @@ public:
more.buffer[i] = literal[i];
}
}
+#endif
constexpr sal_Int32 getLength() const { return more.length; }
diff --git a/include/rtl/stringutils.hxx b/include/rtl/stringutils.hxx
index b8a978efbcc6..fa6c82f50d6f 100644
--- a/include/rtl/stringutils.hxx
+++ b/include/rtl/stringutils.hxx
@@ -246,7 +246,7 @@ struct ConstCharArrayDetector< const char[ 1 ], T >
};
#endif
-#if defined LIBO_INTERNAL_ONLY
+#if defined LIBO_INTERNAL_ONLY && !(defined _MSC_VER && _MSC_VER == 1937 && defined _MANAGED)
template<std::size_t N, typename T>
struct ConstCharArrayDetector<char8_t const [N], T> {
using Type = T;
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 41af86e13119..a96dac187455 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -124,7 +124,9 @@ public:
explicit OUStringBuffer(bool) = delete;
explicit OUStringBuffer(char) = delete;
explicit OUStringBuffer(wchar_t) = delete;
+#if !(defined _MSC_VER && _MSC_VER == 1937 && defined _MANAGED)
explicit OUStringBuffer(char8_t) = delete;
+#endif
explicit OUStringBuffer(char16_t) = delete;
explicit OUStringBuffer(char32_t) = delete;
#endif