summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx2
-rw-r--r--include/sal/types.h16
2 files changed, 17 insertions, 1 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 1ab587040b82..be1b2c2b5cc2 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1173,7 +1173,7 @@ void InterfaceType::dumpDeclaration(FileStream & out)
out << "protected:\n";
inc();
out << indent() << "~" << id_
- << ("() throw () {} // avoid warnings about virtual members and"
+ << ("() SAL_NOEXCEPT {} // avoid warnings about virtual members and"
" non-virtual dtor\n");
dec();
out << "};\n\n";
diff --git a/include/sal/types.h b/include/sal/types.h
index 7733920f20be..5fac8e8f9d3b 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -328,7 +328,11 @@ typedef struct _sal_Sequence
This is a macro so it can expand to nothing in C code.
*/
#if defined __cplusplus
+#if __cplusplus >= 201103L
+#define SAL_THROW_EXTERN_C() noexcept
+#else
#define SAL_THROW_EXTERN_C() throw ()
+#endif
#else
#define SAL_THROW_EXTERN_C()
#endif
@@ -400,6 +404,18 @@ namespace css = ::com::sun::star;
#define SAL_CONSTEXPR
#endif
+/** Macro for C++11 "noexcept" vs. "throw ()" exception specification.
+
+ The latter has has been removed completely from C++20.
+
+ @since LibreOffice 7.2
+ */
+#if __cplusplus >= 201103L
+#define SAL_NOEXCEPT noexcept
+#else
+#define SAL_NOEXCEPT throw ()
+#endif
+
#endif /* __cplusplus */
#ifdef __cplusplus