summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qhostaddress.cpp
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@digia.com>2013-12-05 13:15:11 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-06 15:06:47 +0100
commitfadcb0a72b59a8c7082dc9c893b76125b8f6caf3 (patch)
tree3e81fd090371250e6579928ccbe91a4205d677e2 /src/network/kernel/qhostaddress.cpp
parentfa2f92c9e95fd0114710fc2a9fe0431e16c747f5 (diff)
WinRT: Added networkinterface and hostinfo
While QHostInfo and QNetworkInterface are implemented, socket implementation is just a stub for now. Having stub implementation is preferable over not having them at all is because most applications will not build, if sockets are not available. Even though they do not do anything useful yet, applications can be compiled and run to get an idea how network will work on WinRT. Change-Id: I78ea88901a30280d4098b75ef7398c2628dd19c8 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Diffstat (limited to 'src/network/kernel/qhostaddress.cpp')
-rw-r--r--src/network/kernel/qhostaddress.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index 18fd6dee58..0ab72191dc 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE
// sockaddr_in6 size changed between old and new SDK
// Only the new version is the correct one, so always
// use this structure.
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_WINRT)
# if !defined(u_char)
# define u_char unsigned char
# endif
@@ -448,10 +448,12 @@ QHostAddress::QHostAddress(const QString &address)
QHostAddress::QHostAddress(const struct sockaddr *sockaddr)
: d(new QHostAddressPrivate)
{
+#ifndef Q_OS_WINRT
if (sockaddr->sa_family == AF_INET)
setAddress(htonl(((sockaddr_in *)sockaddr)->sin_addr.s_addr));
else if (sockaddr->sa_family == AF_INET6)
setAddress(((qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr);
+#endif
}
/*!
@@ -604,11 +606,13 @@ bool QHostAddress::setAddress(const QString &address)
*/
void QHostAddress::setAddress(const struct sockaddr *sockaddr)
{
+#ifndef Q_OS_WINRT
clear();
if (sockaddr->sa_family == AF_INET)
setAddress(htonl(((sockaddr_in *)sockaddr)->sin_addr.s_addr));
else if (sockaddr->sa_family == AF_INET6)
setAddress(((qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr);
+#endif
}
/*!