Add support for getaddrinfo using MinGW in tst_qhostinfo
Change-Id: Ief9ddd22171ec2b852ca504957e0e11b90badccb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
78a239bc6d
commit
e010dcf12c
@ -11,5 +11,8 @@ wince*: {
|
|||||||
win32:LIBS += -lws2_32
|
win32:LIBS += -lws2_32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# needed for getaddrinfo with official MinGW
|
||||||
|
win32-g++*:DEFINES += _WIN32_WINNT=0x0501
|
||||||
|
|
||||||
linux-*:CONFIG+=insignificant_test # QTBUG-23837 - test is unstable
|
linux-*:CONFIG+=insignificant_test # QTBUG-23837 - test is unstable
|
||||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
|
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
|
||||||
|
@ -44,16 +44,10 @@
|
|||||||
// (except qglobal.h), or else you'll get tons of compile errors
|
// (except qglobal.h), or else you'll get tons of compile errors
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
// MinGW doesn't provide getaddrinfo(), so we test for Q_OS_WIN
|
|
||||||
// and Q_CC_GNU, which indirectly tells us whether we're using MinGW.
|
|
||||||
#if defined(Q_OS_WIN) && defined(Q_CC_GNU)
|
|
||||||
# define QT_NO_GETADDRINFO
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// To prevent windows system header files from re-defining min/max
|
// To prevent windows system header files from re-defining min/max
|
||||||
#define NOMINMAX 1
|
#define NOMINMAX 1
|
||||||
|
|
||||||
#if defined(Q_OS_WIN) && !defined(QT_NO_GETADDRINFO)
|
#if defined(Q_OS_WIN)
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <ws2tcpip.h>
|
# include <ws2tcpip.h>
|
||||||
#endif
|
#endif
|
||||||
@ -216,7 +210,7 @@ void tst_QHostInfo::initTestCase()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// HP-UX 11i does not support IPv6 reverse lookups.
|
// HP-UX 11i does not support IPv6 reverse lookups.
|
||||||
#if !defined(QT_NO_GETADDRINFO) || !(defined(Q_OS_HPUX) && defined(__ia64))
|
#if !defined(QT_NO_GETADDRINFO) && !(defined(Q_OS_HPUX) && defined(__ia64))
|
||||||
// check if the system getaddrinfo can do IPv6 lookups
|
// check if the system getaddrinfo can do IPv6 lookups
|
||||||
struct addrinfo hint, *result = 0;
|
struct addrinfo hint, *result = 0;
|
||||||
memset(&hint, 0, sizeof hint);
|
memset(&hint, 0, sizeof hint);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user