After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756868 - Fix compilation with WINVER=0x600 and _WINNT_WIN32=0x600
Fix compilation with WINVER=0x600 and _WINNT_WIN32=0x600
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: win32
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-20 13:45 UTC by Sebastian Dröge (slomo)
Modified: 2018-05-24 18:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix compilation with WINVER=0x600 and _WINNT_WIN32=0x600 (2.53 KB, patch)
2015-10-20 13:45 UTC, Sebastian Dröge (slomo)
needs-work Details | Review

Description Sebastian Dröge (slomo) 2015-10-20 13:45:32 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?
Comment 1 Sebastian Dröge (slomo) 2015-10-20 13:45:36 UTC
Created attachment 313746 [details] [review]
Fix compilation with WINVER=0x600 and _WINNT_WIN32=0x600
Comment 2 Sebastian Dröge (slomo) 2015-10-20 13:48:15 UTC
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
Comment 3 Sebastian Dröge (slomo) 2015-10-20 15:07:09 UTC
The NTSTATUS one is handled in bug #756875 and independent from the other things here.
Comment 4 Sebastian Dröge (slomo) 2015-12-28 10:01:01 UTC
What should be done about this one? Fan, Ignacio?
Comment 5 Fan, Chun-wei 2016-01-05 07:36:58 UTC
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.
Comment 6 Philip Withnall 2017-10-11 10:50:06 UTC
Note that some of this is duplicated on bug #788180, which is likely to get pushed first since the patch here is outdated.
Comment 7 GNOME Infrastructure Team 2018-05-24 18:18:34 UTC
-- 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.