summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx3
-rw-r--r--include/comphelper/errcode.hxx4
2 files changed, 6 insertions, 1 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 235e55017610..514e99915834 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3014,6 +3014,9 @@ void ExceptionType::dumpHdlFile(
if (name_ == "com.sun.star.uno.Exception")
{
includes.addCustom("#if defined(LIBO_INTERNAL_ONLY)");
+ includes.addCustom("#if __has_include(<version>)");
+ includes.addCustom("#include <version>");
+ includes.addCustom("#endif");
includes.addCustom("#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907");
includes.addCustom("#include <source_location>");
includes.addCustom("#define LIBO_USE_SOURCE_LOCATION std");
diff --git a/include/comphelper/errcode.hxx b/include/comphelper/errcode.hxx
index 662ec139164b..8198512ff3e1 100644
--- a/include/comphelper/errcode.hxx
+++ b/include/comphelper/errcode.hxx
@@ -23,9 +23,11 @@
#include <ostream>
#include <o3tl/typed_flags_set.hxx>
#include <optional>
-#include <version>
#if defined(DBG_UTIL)
+#if __has_include(<version>)
+#include <version>
+#endif
#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907
#include <source_location>
#define LIBO_ERRMSG_USE_SOURCE_LOCATION std