summaryrefslogtreecommitdiffstats
path: root/src/plugins/canbus/tinycan
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2019-09-21 14:55:08 +0200
committerAndre Hartmann <aha_1980@gmx.de>2019-09-23 09:46:23 +0200
commit80144b89ca1adede0db9d6e485037f5e431216c3 (patch)
treeab6283d9282201c752499e260ecbeae6a8b732c1 /src/plugins/canbus/tinycan
parente6b042a795902226c7d7f1ec576c8e063ef76740 (diff)
CAN: Avoid symbol clashes on static builds
Having the same function name in a global namespace can lead the linker to pick an arbitrary one instead the right one. [ChangeLog] Fixed problems on static builds where an arbitrary version of resolveSymbol() was used instead the correct one. Fixes: QTBUG-78546 Change-Id: I0ff9bc3e5905b3b9694dfe9d446b2a52700f213f Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'src/plugins/canbus/tinycan')
-rw-r--r--src/plugins/canbus/tinycan/tinycan_symbols_p.h2
-rw-r--r--src/plugins/canbus/tinycan/tinycanbackend.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/canbus/tinycan/tinycan_symbols_p.h b/src/plugins/canbus/tinycan/tinycan_symbols_p.h
index 44dffd6..625edd3 100644
--- a/src/plugins/canbus/tinycan/tinycan_symbols_p.h
+++ b/src/plugins/canbus/tinycan/tinycan_symbols_p.h
@@ -317,7 +317,7 @@ GENERATE_SYMBOL_VARIABLE(void, CanSetRxEventCallback, CanRxEventCallback)
GENERATE_SYMBOL_VARIABLE(void, CanSetEvents, quint16)
GENERATE_SYMBOL_VARIABLE(quint32, CanEventStatus, void)
-inline bool resolveSymbols(QLibrary *mhstcanLibrary)
+inline bool resolveTinyCanSymbols(QLibrary *mhstcanLibrary)
{
if (!mhstcanLibrary->isLoaded()) {
mhstcanLibrary->setFileName(QStringLiteral("mhstcan"));
diff --git a/src/plugins/canbus/tinycan/tinycanbackend.cpp b/src/plugins/canbus/tinycan/tinycanbackend.cpp
index 3891186..496770a 100644
--- a/src/plugins/canbus/tinycan/tinycanbackend.cpp
+++ b/src/plugins/canbus/tinycan/tinycanbackend.cpp
@@ -62,7 +62,7 @@ bool TinyCanBackend::canCreate(QString *errorReason)
#ifdef LINK_LIBMHSTCAN
return true;
#else
- static bool symbolsResolved = resolveSymbols(mhstcanLibrary());
+ static bool symbolsResolved = resolveTinyCanSymbols(mhstcanLibrary());
if (Q_UNLIKELY(!symbolsResolved)) {
*errorReason = mhstcanLibrary()->errorString();
return false;