GNOME Bugzilla – Bug 756868
Fix compilation with WINVER=0x600 and _WINNT_WIN32=0x600
Last modified: 2018-05-24 18:18:34 UTC
The patch is not mergeable as-is, but comments please about how to approach this. Also what's the WINAPI_FAMILY != MODERN_API_FAMILY stuff about?
Created attachment 313746 [details] [review] Fix compilation with WINVER=0x600 and _WINNT_WIN32=0x600
Review of attachment 313746 [details] [review]: ::: configure.ac @@ +2533,3 @@ ;; *-*-mingw*) + G_LIBS_EXTRA="-lws2_32 -lole32 -lwinmm -lshlwapi -liphlpapi" iphlpapi needed for if_nametoindex ::: gio/ginetaddress.c @@ +469,3 @@ +#else +static gint +inet_pton (gint family, mingw has these in ws2_32 but not in any headers (?!) ::: glib/gwin32.c @@ +50,3 @@ +#if WINAPI_FAMILY != MODERN_API_FAMILY +#include <ntdef.h> +#endif Needed for NSSTATUS as used below. I see nothing that defines WINAPI_FAMILY anywhere
The NTSTATUS one is handled in bug #756875 and independent from the other things here.
What should be done about this one? Fan, Ignacio?
Review of attachment 313746 [details] [review]: Hi Sabastien, I'm not that much knowledgeable about the situation on MinGW/mingw-w64, but these are my take on these items... Sorry about the delay. With blessings, thank you! ::: configure.ac @@ +142,3 @@ esac + AC_DEFINE([_WIN32_WINNT], [0x0600], [Target the Windows XP API]) Let's change the "Target the Windows XP API" to "Target the Windows Vista API". When this goes in, GIO will not support XP anymore, which is what we would actually like to do in the longer term. ::: gio/ginetaddress.c @@ +467,3 @@ } } +#else I don't know about MinGW32, but in my mingw-w64 installation, they do exist as aliases of InetNtopA and InetPtonA in ws2tcpip.h, which is actually in line with the case on Visual Studio. ::: glib/gwin32.c @@ +49,3 @@ # include <io.h> +#if WINAPI_FAMILY != MODERN_API_FAMILY +#include <ntdef.h> Well, WINAPI_FAMILY is meant for newer Visual Studio or other toolsets that are capable of building Windows Store (aka Modern UI or Metro apps), it is there so that the blacklisted Windows APIs will be hidden from the programmer. As in the other bug mentioned, the NTSTATUS issue was fixed for mingw-w64 and MinGW32.
Note that some of this is duplicated on bug #788180, which is likely to get pushed first since the patch here is outdated.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1097.