summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@digia.com>2013-09-25 16:05:09 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-27 18:31:23 +0200
commit4aca7847be8bd9e146de876c2b73fa91ef0aa646 (patch)
tree89f2d9509b122857279fa3df1c65643cc798c3ab /src/network
parentec716cc5bf267e6895f673f4be76e3422cf86d3d (diff)
Fix open ssl forwarding macros.
This patch fixes them in many ways: - use Q_UNLIKELY to mark an error case - reduce QtNetwork library size by 40315 bytes - fix DEFINEFUNC9 which had wrong logic, happily it was not used anywhere Change-Id: Ic46a569f85aa22a00ecd88158e60c52f4665ec4c Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp7
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h33
2 files changed, 24 insertions, 16 deletions
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index a010075436..7c3cfb2012 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -114,6 +114,13 @@ QT_BEGIN_NAMESPACE
possibly with a different version of OpenSSL.
*/
+namespace {
+void qsslSocketUnresolvedSymbolWarning(const char *functionName)
+{
+ qWarning("QSslSocket: cannot call unresolved function %s", functionName);
+}
+}
+
#ifdef SSLEAY_MACROS
DEFINEFUNC3(void *, ASN1_dup, i2d_of_void *a, a, d2i_of_void *b, b, char *c, c, return 0, return)
#endif
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 1fd98cc7fb..7e1a1c983c 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -69,6 +69,7 @@
//
#include "qsslsocket_openssl_p.h"
+#include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE
@@ -82,8 +83,8 @@ QT_BEGIN_NAMESPACE
typedef ret (*_q_PTR_##func)(arg); \
static _q_PTR_##func _q_##func = 0; \
ret q_##func(arg) { \
- if (!_q_##func) { \
- qWarning("QSslSocket: cannot call unresolved function "#func); \
+ if (Q_UNLIKELY(!_q_##func)) { \
+ qsslSocketUnresolvedSymbolWarning(#func); \
err; \
} \
funcret _q_##func(a); \
@@ -94,8 +95,8 @@ QT_BEGIN_NAMESPACE
typedef ret (*_q_PTR_##func)(arg1, arg2); \
static _q_PTR_##func _q_##func = 0; \
ret q_##func(arg1, arg2) { \
- if (!_q_##func) { \
- qWarning("QSslSocket: cannot call unresolved function "#func);\
+ if (Q_UNLIKELY(!_q_##func)) { \
+ qsslSocketUnresolvedSymbolWarning(#func);\
err; \
} \
funcret _q_##func(a, b); \
@@ -106,8 +107,8 @@ QT_BEGIN_NAMESPACE
typedef ret (*_q_PTR_##func)(arg1, arg2, arg3); \
static _q_PTR_##func _q_##func = 0; \
ret q_##func(arg1, arg2, arg3) { \
- if (!_q_##func) { \
- qWarning("QSslSocket: cannot call unresolved function "#func); \
+ if (Q_UNLIKELY(!_q_##func)) { \
+ qsslSocketUnresolvedSymbolWarning(#func); \
err; \
} \
funcret _q_##func(a, b, c); \
@@ -118,8 +119,8 @@ QT_BEGIN_NAMESPACE
typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4); \
static _q_PTR_##func _q_##func = 0; \
ret q_##func(arg1, arg2, arg3, arg4) { \
- if (!_q_##func) { \
- qWarning("QSslSocket: cannot call unresolved function "#func); \
+ if (Q_UNLIKELY(!_q_##func)) { \
+ qsslSocketUnresolvedSymbolWarning(#func); \
err; \
} \
funcret _q_##func(a, b, c, d); \
@@ -130,8 +131,8 @@ QT_BEGIN_NAMESPACE
typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5); \
static _q_PTR_##func _q_##func = 0; \
ret q_##func(arg1, arg2, arg3, arg4, arg5) { \
- if (!_q_##func) { \
- qWarning("QSslSocket: cannot call unresolved function "#func); \
+ if (Q_UNLIKELY(!_q_##func)) { \
+ qsslSocketUnresolvedSymbolWarning(#func); \
err; \
} \
funcret _q_##func(a, b, c, d, e); \
@@ -142,8 +143,8 @@ QT_BEGIN_NAMESPACE
typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5, arg6); \
static _q_PTR_##func _q_##func = 0; \
ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6) { \
- if (!_q_##func) { \
- qWarning("QSslSocket: cannot call unresolved function "#func); \
+ if (Q_UNLIKELY(!_q_##func)) { \
+ qsslSocketUnresolvedSymbolWarning(#func); \
err; \
} \
funcret _q_##func(a, b, c, d, e, f); \
@@ -154,8 +155,8 @@ QT_BEGIN_NAMESPACE
typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
static _q_PTR_##func _q_##func = 0; \
ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \
- if (!_q_##func) { \
- qWarning("QSslSocket: cannot call unresolved function "#func); \
+ if (Q_UNLIKELY(!_q_##func)) { \
+ qsslSocketUnresolvedSymbolWarning(#func); \
err; \
} \
funcret _q_##func(a, b, c, d, e, f, g); \
@@ -166,8 +167,8 @@ QT_BEGIN_NAMESPACE
typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
static _q_PTR_##func _q_##func = 0; \
ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { \
- if (_q_##func) { \
- qWarning("QSslSocket: cannot call unresolved function "#func); \
+ if (Q_UNLIKELY(!_q_##func)) { \
+ qsslSocketUnresolvedSymbolWarning(#func); \
err; \
} \
funcret _q_##func(a, b, c, d, e, f, g, h, i); \