diff options
author | Andre Hartmann <aha_1980@gmx.de> | 2019-09-21 14:55:08 +0200 |
---|---|---|
committer | Andre Hartmann <aha_1980@gmx.de> | 2019-09-23 09:46:23 +0200 |
commit | 80144b89ca1adede0db9d6e485037f5e431216c3 (patch) | |
tree | ab6283d9282201c752499e260ecbeae6a8b732c1 /src/plugins/canbus/peakcan | |
parent | e6b042a795902226c7d7f1ec576c8e063ef76740 (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/peakcan')
-rw-r--r-- | src/plugins/canbus/peakcan/peakcan_symbols_p.h | 2 | ||||
-rw-r--r-- | src/plugins/canbus/peakcan/peakcanbackend.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/canbus/peakcan/peakcan_symbols_p.h b/src/plugins/canbus/peakcan/peakcan_symbols_p.h index 9ab2e67..b42deb7 100644 --- a/src/plugins/canbus/peakcan/peakcan_symbols_p.h +++ b/src/plugins/canbus/peakcan/peakcan_symbols_p.h @@ -328,7 +328,7 @@ GENERATE_SYMBOL_VARIABLE(TPCANStatus, CAN_GetValue, TPCANHandle, TPCANParameter, GENERATE_SYMBOL_VARIABLE(TPCANStatus, CAN_SetValue, TPCANHandle, TPCANParameter, void *, quint32) GENERATE_SYMBOL_VARIABLE(TPCANStatus, CAN_GetErrorText, TPCANStatus, quint16, char *) -inline bool resolveSymbols(QLibrary *pcanLibrary) +inline bool resolvePeakCanSymbols(QLibrary *pcanLibrary) { if (!pcanLibrary->isLoaded()) { pcanLibrary->setFileName(QStringLiteral("pcanbasic")); diff --git a/src/plugins/canbus/peakcan/peakcanbackend.cpp b/src/plugins/canbus/peakcan/peakcanbackend.cpp index f8932e9..411223a 100644 --- a/src/plugins/canbus/peakcan/peakcanbackend.cpp +++ b/src/plugins/canbus/peakcan/peakcanbackend.cpp @@ -66,7 +66,7 @@ bool PeakCanBackend::canCreate(QString *errorReason) #ifdef LINK_LIBPCANBASIC return true; #else - static bool symbolsResolved = resolveSymbols(pcanLibrary()); + static bool symbolsResolved = resolvePeakCanSymbols(pcanLibrary()); if (Q_UNLIKELY(!symbolsResolved)) { *errorReason = pcanLibrary()->errorString(); return false; |