From 556705cb9c826d70c043d67a87d997f82e2a559d Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Sat, 24 Oct 2015 11:05:27 +0800 Subject: [PATCH] gwin32.c: Fix build on Visual Studio ntdef.h is a header that is normally only shipped with MinGW, not Visual Studio, which broke the build in commit 975cb91. Fix this by including winternl.h, which typedef's the NTSTATUS type in question on both Visual Studio and MinGW/mingw-w64, as well as pre-2008 Visual Studio. Clean up this inclusion part a little bit as well. --- glib/gwin32.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/glib/gwin32.c b/glib/gwin32.c index a0cbd1d44..ce462bb4a 100644 --- a/glib/gwin32.c +++ b/glib/gwin32.c @@ -51,10 +51,6 @@ #define MODERN_API_FAMILY 2 -#if WINAPI_FAMILY != MODERN_API_FAMILY -# include -#endif - #if WINAPI_FAMILY == MODERN_API_FAMILY /* This is for modern UI Builds, where we can't use LoadLibraryW()/GetProcAddress() */ /* ntddk.h is found in the WDK, and MinGW */ @@ -63,6 +59,8 @@ #ifdef _MSC_VER #pragma comment (lib, "ntoskrnl.lib") #endif +#else +#include #endif #include "glib.h"