diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-12-25 11:35:46 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-12-25 11:54:49 +0100 |
commit | 91b1153bb75d7527e7de3aacc476259563292ab4 (patch) | |
tree | a4eb3e4c0600b0ca9c69a6006b743c7d72dcb1c3 /codemaker/source | |
parent | f90d00a43f9fd1e14ac42f43c11e5f7eb966a355 (diff) |
Move LIBO_USE_SOURCE_LOCATION to o3tl for possible reuse
Change-Id: I045fc1d86576f6017def01a14dd9a091ee35a544
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179323
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'codemaker/source')
-rw-r--r-- | codemaker/source/cppumaker/cpputype.cxx | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 5f6d47ac6c70..aa332fb026e7 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -2819,16 +2819,7 @@ void ExceptionType::dumpHdlFile( if (name_ == "com.sun.star.uno.Exception") { includes.addCustom(u"#if defined(LIBO_INTERNAL_ONLY) && !defined(NDEBUG)"_ustr); - includes.addCustom(u"#if __has_include(<version>)"_ustr); - includes.addCustom(u"#include <version>"_ustr); - includes.addCustom(u"#endif"_ustr); - includes.addCustom(u"#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907"_ustr); - includes.addCustom(u"#include <source_location>"_ustr); - includes.addCustom(u"#define LIBO_USE_SOURCE_LOCATION std"_ustr); - includes.addCustom(u"#elif __has_include(<experimental/source_location>)"_ustr); - includes.addCustom(u"#include <experimental/source_location>"_ustr); - includes.addCustom(u"#define LIBO_USE_SOURCE_LOCATION std::experimental"_ustr); - includes.addCustom(u"#endif"_ustr); + includes.addCustom(u"#include <o3tl/source_location.hxx>"_ustr); includes.addCustom(u"#endif"_ustr); includes.addCustom(u"#if defined LIBO_USE_SOURCE_LOCATION"_ustr); includes.addCustom(u"#include <o3tl/runtimetooustring.hxx>"_ustr); @@ -2870,9 +2861,9 @@ void ExceptionType::dumpHppFile( // default constructor out << "\ninline " << id_ << "::" << id_ << "(\n"; out << "#if defined LIBO_USE_SOURCE_LOCATION\n"; - out << " LIBO_USE_SOURCE_LOCATION::source_location location\n"; + out << " o3tl::source_location location\n"; out << "#endif\n"; - out << " )\n"; + out << ")\n"; inc(); OUString base(entity_->getDirectBase()); bool bFirst = true; @@ -2925,7 +2916,7 @@ void ExceptionType::dumpHppFile( bFirst = false; } out << "\n#if defined LIBO_USE_SOURCE_LOCATION\n"; - out << " " << (bFirst ? "" : ", ") << "LIBO_USE_SOURCE_LOCATION::source_location location\n"; + out << " " << (bFirst ? "" : ", ") << "o3tl::source_location location\n"; out << "#endif\n"; out << ")\n"; inc(); @@ -3186,9 +3177,9 @@ void ExceptionType::dumpDeclaration(FileStream & out) // default constructor out << indent() << "inline CPPU_GCC_DLLPRIVATE " << id_ << "(\n"; out << "#if defined LIBO_USE_SOURCE_LOCATION\n"; - out << " LIBO_USE_SOURCE_LOCATION::source_location location = LIBO_USE_SOURCE_LOCATION::source_location::current()\n"; - out << "#endif\n\n"; - out << " );\n"; + out << " o3tl::source_location location = o3tl::source_location::current()\n"; + out << "#endif\n"; + out << " );\n\n"; // constructor that initializes data members if (!entity_->getDirectMembers().empty() || getInheritedMemberCount() > 0) { @@ -3204,7 +3195,7 @@ void ExceptionType::dumpDeclaration(FileStream & out) bFirst = false; } out << "\n#if defined LIBO_USE_SOURCE_LOCATION\n"; - out << ", LIBO_USE_SOURCE_LOCATION::source_location location = LIBO_USE_SOURCE_LOCATION::source_location::current()\n"; + out << " , o3tl::source_location location = o3tl::source_location::current()\n"; out << "#endif\n"; out << " );\n\n"; } |