Fixed compile of QSslSocket with -qtnamespace on Windows.
authorRohan McGovern <rohan.mcgovern@nokia.com>
Mon, 30 Apr 2012 06:09:05 +0000 (16:09 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 1 May 2012 10:38:07 +0000 (12:38 +0200)
Q_DECLARE_METATYPE must be outside of the qt namespace.

System headers must be included outside of the qt namespace.

Change-Id: I2f48b1df87e5edae2baee6ce813af08d3e011dc0
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
src/network/ssl/qsslsocket_openssl.cpp
src/network/ssl/qsslsocket_p.h

index 2247148..bac837e 100644 (file)
 #include <QtCore/qvarlengtharray.h>
 #include <QLibrary> // for loading the security lib for the CA store
 
+#ifdef Q_OS_WIN
+Q_DECLARE_METATYPE(QSslCertificate);
+#endif
+
 QT_BEGIN_NAMESPACE
 
 #if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
@@ -1340,8 +1344,6 @@ void QSslSocketBackendPrivate::_q_caRootLoaded(QSslCertificate cert, QSslCertifi
         continueHandshake();
 }
 
-Q_DECLARE_METATYPE(QSslCertificate);
-
 class QWindowsCaRootFetcherThread : public QThread
 {
 public:
index 3b97b5d..5e3148d 100644 (file)
 
 #include <private/qringbuffer_p.h>
 
-QT_BEGIN_NAMESPACE
-
 #if defined(Q_OS_MAC)
 #include <Security/SecCertificate.h>
 #include <CoreFoundation/CFArray.h>
-#ifndef Q_OS_IOS
-    typedef OSStatus (*PtrSecCertificateGetData)(SecCertificateRef, CSSM_DATA_PTR);
-    typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*);
-    typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*);
-#endif
 #elif defined(Q_OS_WIN)
 #include <QtCore/qt_windows.h>
 #include <wincrypt.h>
 #ifndef HCRYPTPROV_LEGACY
 #define HCRYPTPROV_LEGACY HCRYPTPROV
 #endif
+#endif
+
+QT_BEGIN_NAMESPACE
+
+#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
+    typedef OSStatus (*PtrSecCertificateGetData)(SecCertificateRef, CSSM_DATA_PTR);
+    typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*);
+    typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*);
+#endif
+
+#if defined(Q_OS_WIN)
 #if defined(Q_OS_WINCE)
     typedef HCERTSTORE (WINAPI *PtrCertOpenSystemStoreW)(LPCSTR, DWORD, HCRYPTPROV_LEGACY, DWORD, const void*);
 #else