Windows: Use Standard Networking Functions If Possible
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 5 Mar 2015 08:13:03 +0000 (16:13 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 6 Mar 2015 15:40:03 +0000 (23:40 +0800)
commit6fe28eef3ce5dd7ce12c6ace080bac5d9479f50c
tree59a2322aefc7da2bdbacd252c005f28617ea4621
parentec1edef3ab171f1fa24d62858a2643de6e582f58
Windows: Use Standard Networking Functions If Possible

Currently, the Windows code use Winsock2-specific APIs to try to emulate
calls such as inet_pton(), inet_ntop() and if_nametoindex(), which may not
do the job all the time.  On Vista and later, Winsock2 does provide a
proper implementation for these functions, so we can use them if they exist
on the system, by querying for them during g_networking_init().  Otherwise,
we continue to use the original code path for these, in the case of XP and
Server 2003.

This enables many of the network-address tests to pass on Windows as a
result, when the native Winsock2 implementations can be used.

https://bugzilla.gnome.org/show_bug.cgi?id=730352
gio/Makefile.am
gio/ginetaddress.c
gio/gnetworking.c
gio/gsocket.c
gio/gwin32networking.h [new file with mode: 0644]