desktop/source/deployment/misc/dp_platform.cxx | 28 ++++++++++++++----------- desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 19 ++++++++-------- 2 files changed, 26 insertions(+), 21 deletions(-)
New commits: commit b1432ad59d6210da49e8c5c113ef2585d2203ca9 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Tue May 7 20:47:41 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue May 7 22:38:50 2024 +0200 workaround compiler crash on macos-intel Change-Id: I779785c068fd04e314b4d6c22d9fe66d9aa88736 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167294 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx index bd22a8a788b4..77239ec4e4b9 100644 --- a/desktop/source/deployment/misc/dp_platform.cxx +++ b/desktop/source/deployment/misc/dp_platform.cxx @@ -31,25 +31,29 @@ namespace dp_misc { namespace { + OUString StrOperatingSystemInit() + { + OUString os( u"$_OS"_ustr ); + ::rtl::Bootstrap::expandMacros( os ); + return os; + } + const OUString & StrOperatingSystem() { - static const OUString theOS = []() - { - OUString os( u"$_OS"_ustr ); - ::rtl::Bootstrap::expandMacros( os ); - return os; - }(); + static const OUString theOS = StrOperatingSystemInit(); return theOS; }; + OUString StrCPUInit() + { + OUString arch( u"$_ARCH"_ustr ); + ::rtl::Bootstrap::expandMacros( arch ); + return arch; + } + const OUString & StrCPU() { - static const OUString theCPU = []() - { - OUString arch( u"$_ARCH"_ustr ); - ::rtl::Bootstrap::expandMacros( arch ); - return arch; - }(); + static const OUString theCPU = StrCPUInit(); return theCPU; }; diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index 5577a840faf6..c0b7058b2206 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -155,17 +155,18 @@ bool readArgument( } +static OUString getExecutableDirInit() +{ + OUString path; + if (osl_getExecutableFile( &path.pData ) != osl_Process_E_None) { + throw RuntimeException(u"cannot locate executable directory!"_ustr,nullptr); + } + return path.copy( 0, path.lastIndexOf( '/' ) ); +} + OUString const & getExecutableDir() { - static const OUString EXEC = - []() - { - OUString path; - if (osl_getExecutableFile( &path.pData ) != osl_Process_E_None) { - throw RuntimeException(u"cannot locate executable directory!"_ustr,nullptr); - } - return path.copy( 0, path.lastIndexOf( '/' ) ); - }(); + static const OUString EXEC = getExecutableDirInit(); return EXEC; }