diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2011-10-07 12:45:33 (GMT) |
---|---|---|
committer | Jan-Arve Saether <jan-arve.saether@nokia.com> | 2011-10-07 12:45:33 (GMT) |
commit | 74251fb0fc57b1e0f7db0b561e4aa4c0347f6f37 (patch) | |
tree | c502d03701b8a700f9c0e83aadac4acc7ea975d5 /src/network/kernel | |
parent | 1bfef526ef3d1deb7cf0f11dc1880f33937a85ac (diff) | |
download | Qt-74251fb0fc57b1e0f7db0b561e4aa4c0347f6f37.zip Qt-74251fb0fc57b1e0f7db0b561e4aa4c0347f6f37.tar.gz Qt-74251fb0fc57b1e0f7db0b561e4aa4c0347f6f37.tar.bz2 |
simplify the code by using QSystemLibrary a bit smarter
Merge-request: 2655
Reviewed-by: Jan-Arve Saether <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/network/kernel')
-rw-r--r-- | src/network/kernel/qhostinfo_win.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp index 6fc5b7b..03e72c4 100644 --- a/src/network/kernel/qhostinfo_win.cpp +++ b/src/network/kernel/qhostinfo_win.cpp @@ -85,14 +85,15 @@ static void resolveLibrary() // Attempt to resolve getaddrinfo(); without it we'll have to fall // back to gethostbyname(), which has no IPv6 support. #if !defined(Q_OS_WINCE) - local_getaddrinfo = (getaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getaddrinfo"); - local_freeaddrinfo = (freeaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "freeaddrinfo"); - local_getnameinfo = (getnameinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getnameinfo"); + QSystemLibrary ws2lib(QLatin1String("ws2_32")); #else - local_getaddrinfo = (getaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "getaddrinfo"); - local_freeaddrinfo = (freeaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "freeaddrinfo"); - local_getnameinfo = (getnameinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "getnameinfo"); + QSystemLibrary ws2lib(QLatin1String("ws2")); #endif + if (ws2lib.load()) { + local_getaddrinfo = (getaddrinfoProto)ws2lib.resolve("getaddrinfo"); + local_freeaddrinfo = (freeaddrinfoProto)ws2lib.resolve("freeaddrinfo"); + local_getnameinfo = (getnameinfoProto)ws2lib.resolve("getnameinfo"); + } } #if defined(Q_OS_WINCE) |