codemaker/source/cppumaker/cpputype.cxx | 3 +++ include/comphelper/errcode.hxx | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-)
New commits: commit 27e7a6199231b8b9942724c86d0a22126e71862e Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Fri Oct 13 13:36:19 2023 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Oct 13 16:46:07 2023 +0200 Follow-up on "Make sure __cpp_lib_source_location is consistently defined" (113e064117b2632974a696b950634229d70c5b96). Mike pointed out that I forgot to fix the generated code and that "https://en.cppreference.com/w/cpp/compiler_support/20 lists <version> as supported since gcc libstdc++ 9, and README.md requires libstdc++ 8.5." Change-Id: Ic7477e39e334735c4a563195fee335a599a0ef79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157933 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> 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