workaround clang segfault on macos-intel

Change-Id: Icfced4a990e2d02995bff4078f14b8ee26e9cca3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167497
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2024-05-11 14:50:28 +02:00
committed by Noel Grandin
parent 57fce217fa
commit ed699baa92
2 changed files with 24 additions and 19 deletions
+16 -13
View File
@@ -196,21 +196,24 @@ void fillStruct(
}
}
OUString getLibDir();
OUString getLibDirImpl()
{
OUString libDir;
// workarounds the $(ORIGIN) until it is available
if (Module::getUrlFromAddress(reinterpret_cast<oslGenericFunction>(getLibDir), libDir))
{
libDir = libDir.copy(0, libDir.lastIndexOf('/'));
OUString name(u"PYUNOLIBDIR"_ustr);
rtl_bootstrap_set(name.pData, libDir.pData);
}
return libDir;
}
OUString getLibDir()
{
static OUString sLibDir = []() {
OUString libDir;
// workarounds the $(ORIGIN) until it is available
if (Module::getUrlFromAddress(reinterpret_cast<oslGenericFunction>(getLibDir), libDir))
{
libDir = libDir.copy(0, libDir.lastIndexOf('/'));
OUString name(u"PYUNOLIBDIR"_ustr);
rtl_bootstrap_set(name.pData, libDir.pData);
}
return libDir;
}();
static OUString sLibDir = getLibDirImpl();
return sLibDir;
}
+8 -6
View File
@@ -108,15 +108,17 @@ OUString createPath(std::u16string_view name, sal_Int32 pos, std::u16string_view
return OUString::Concat(name.substr(0, pos + 1)) + locale + name.substr(pos);
}
OUString getIconCacheUrlImpl()
{
OUString sDir = u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/"_ustr;
rtl::Bootstrap::expandMacros(sDir);
return sDir;
}
OUString getIconCacheUrl(std::u16string_view sVariant, ImageRequestParameters const & rParameters)
{
// the macro expansion can be expensive in bulk, so cache that
static OUString CACHE_DIR = []()
{
OUString sDir = u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/"_ustr;
rtl::Bootstrap::expandMacros(sDir);
return sDir;
}();
static OUString CACHE_DIR = getIconCacheUrlImpl();
return CACHE_DIR + rParameters.msStyle + "/" + sVariant + "/" + rParameters.msName;
}