summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qlibrary_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/plugin/qlibrary_unix.cpp')
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 7ffd1369b9..851b9ff82f 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -182,21 +182,23 @@ bool QLibraryPrivate::load_sys()
#if defined(Q_PROCESSOR_X86) && !defined(Q_OS_DARWIN)
if (qCpuHasFeature(ArchHaswell)) {
- auto transform = [](QStringList &list, QString (*f)(QString)) {
+ auto transform = [](QStringList &list, void (*f)(QString *)) {
QStringList tmp;
qSwap(tmp, list);
list.reserve(tmp.size() * 2);
for (const QString &s : qAsConst(tmp)) {
- list.append(f(s));
+ QString modifiedPath = s;
+ f(&modifiedPath);
+ list.append(modifiedPath);
list.append(s);
}
};
if (pluginState == IsAPlugin) {
// add ".avx2" to each suffix in the list
- transform(suffixes, [](QString s) { return s.append(QLatin1String(".avx2")); });
+ transform(suffixes, [](QString *s) { s->append(QLatin1String(".avx2")); });
} else {
// prepend "haswell/" to each prefix in the list
- transform(prefixes, [](QString s) { return s.prepend(QLatin1String("haswell/")); });
+ transform(prefixes, [](QString *s) { s->prepend(QLatin1String("haswell/")); });
}
}
#endif