summaryrefslogtreecommitdiffstats
path: root/src/plugins/canbus/vectorcan
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/vectorcan
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/vectorcan')
-rw-r--r--src/plugins/canbus/vectorcan/vectorcan_symbols_p.h2
-rw-r--r--src/plugins/canbus/vectorcan/vectorcanbackend.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/canbus/vectorcan/vectorcan_symbols_p.h b/src/plugins/canbus/vectorcan/vectorcan_symbols_p.h
index 3f2501f..6e35ba4 100644
--- a/src/plugins/canbus/vectorcan/vectorcan_symbols_p.h
+++ b/src/plugins/canbus/vectorcan/vectorcan_symbols_p.h
@@ -458,7 +458,7 @@ GENERATE_SYMBOL_VARIABLE(XLstatus, xlReceive, XLportHandle, quint32 *, XLevent *
GENERATE_SYMBOL_VARIABLE(XLstatus, xlSetNotification, XLportHandle, XLhandle *, int)
GENERATE_SYMBOL_VARIABLE(char *, xlGetErrorString, XLstatus)
-inline bool resolveSymbols(QLibrary *vectorcanLibrary)
+inline bool resolveVectorCanSymbols(QLibrary *vectorcanLibrary)
{
if (!vectorcanLibrary->isLoaded()) {
#ifdef Q_PROCESSOR_X86_64
diff --git a/src/plugins/canbus/vectorcan/vectorcanbackend.cpp b/src/plugins/canbus/vectorcan/vectorcanbackend.cpp
index 9026888..40ba0ac 100644
--- a/src/plugins/canbus/vectorcan/vectorcanbackend.cpp
+++ b/src/plugins/canbus/vectorcan/vectorcanbackend.cpp
@@ -61,7 +61,7 @@ bool VectorCanBackend::canCreate(QString *errorReason)
#ifdef LINK_LIBVECTORCAN
return true;
#else
- static bool symbolsResolved = resolveSymbols(vectorcanLibrary());
+ static bool symbolsResolved = resolveVectorCanSymbols(vectorcanLibrary());
if (Q_UNLIKELY(!symbolsResolved)) {
*errorReason = vectorcanLibrary()->errorString();
return false;