unotools/source/ucbhelper/tempfile.cxx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
New commits: commit 2330c59de48a40cd5614297afb7fd5e26c8a7b23 Author: Caolán McNamara <[email protected]> AuthorDate: Thu Apr 4 08:46:17 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Apr 4 17:00:14 2024 +0200 ofz#67825 build failure clang frontend command failed with exit code 139 unotools/source/ucbhelper/tempfile.cxx:298:8: current parser token ';' unotools/source/ucbhelper/tempfile.cxx:46:1: parsing namespace '(anonymous)' unotools/source/ucbhelper/tempfile.cxx:278:1: parsing function body '(anonymous namespace)::getEyeCatcher' unotools/source/ucbhelper/tempfile.cxx:278:1: in compound statement ('{}') the very similiar unotools/source/config/docinfohelper.cxx compiles fine according to the log, so tweak to match that Change-Id: I8f1286c88d7c1a70fb3294c84bf1c55109d97ee8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165781 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 149a1413c37a..26735035abbf 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -274,28 +274,30 @@ OUString lcl_createName( return OUString(); } -const OUString& getEyeCatcher() +OUString createEyeCatcher() { - static const OUString sEyeCatcher = [] - { - OUString eyeCatcher = u"lu"_ustr; + OUString eyeCatcher = u"lu"_ustr; #ifdef DBG_UTIL #ifdef UNX - if (const char* eye = getenv("LO_TESTNAME")) - eyeCatcher = OUString(eye, strlen(eye), RTL_TEXTENCODING_ASCII_US); + if (const char* eye = getenv("LO_TESTNAME")) + eyeCatcher = OUString(eye, strlen(eye), RTL_TEXTENCODING_ASCII_US); #elif defined(_WIN32) - if (const wchar_t* eye = _wgetenv(L"LO_TESTNAME")) - eyeCatcher = OUString(o3tl::toU(eye)); + if (const wchar_t* eye = _wgetenv(L"LO_TESTNAME")) + eyeCatcher = OUString(o3tl::toU(eye)); #endif #else #ifdef UNX - eyeCatcher += OUString::number(getpid()); + eyeCatcher += OUString::number(getpid()); #elif defined(_WIN32) - eyeCatcher += OUString::number(_getpid()); + eyeCatcher += OUString::number(_getpid()); #endif #endif - return eyeCatcher; - }(); + return eyeCatcher; +} + +const OUString& getEyeCatcher() +{ + static const OUString sEyeCatcher = createEyeCatcher(); return sEyeCatcher; }
