diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-10-20 18:01:46 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-10-20 18:01:46 +0300 |
commit | 02245a8de6fc828652fc1a7206708d78b30fd9e8 (patch) | |
tree | ba95e83e75b4d73d740b7fe419ed534d21afc7b6 | |
parent | 89995e8a30a37efe560c7b87d2e2b2ae6e643592 (diff) |
glib: Fix compilation on Windows
-rw-r--r-- | recipes/build-tools/glib-tools.recipe | 4 | ||||
-rw-r--r-- | recipes/glib.recipe | 4 | ||||
-rw-r--r-- | recipes/glib/0020-Include-ntdef.h-for-NTSTATUS.patch | 27 |
3 files changed, 33 insertions, 2 deletions
diff --git a/recipes/build-tools/glib-tools.recipe b/recipes/build-tools/glib-tools.recipe index d805567f..e3877a94 100644 --- a/recipes/build-tools/glib-tools.recipe +++ b/recipes/build-tools/glib-tools.recipe @@ -19,7 +19,8 @@ class Recipe(recipe.Recipe): "../glib/0008-gdbus-codgen-Use-a-proper-shebang-in-the-generator.patch", "../glib/0009-Unhide-_g_io_modules_ensure_extension_points_registe.patch", '../glib/0014-Don-t-use-AT_FDCWD-on-iOS-for-now.patch', - '../glib/0015-Implementation-of-Cocoa-event-loop-integration-in-GM.patch' + '../glib/0015-Implementation-of-Cocoa-event-loop-integration-in-GM.patch', + '../glib/0020-Include-ntdef.h-for-NTSTATUS.patch' ] def prepare(self): @@ -27,5 +28,6 @@ class Recipe(recipe.Recipe): self.configure_options += ' --disable-gtk-doc' elif self.config.target_platform == Platform.WINDOWS: self.configure_options = '--with-libiconv=gnu' + self.append_env['CFLAGS'] = ' -DMINGW_HAS_SECURE_API=1 ' elif self.config.target_platform in Platform.DARWIN: self.config_sh = 'CFLAGS="$CFLAGS -DHAVE_STRNDUP" ./configure' diff --git a/recipes/glib.recipe b/recipes/glib.recipe index b0c77e51..c9451ec6 100644 --- a/recipes/glib.recipe +++ b/recipes/glib.recipe @@ -35,7 +35,8 @@ class Recipe(recipe.Recipe): "glib/0008-gdbus-codgen-Use-a-proper-shebang-in-the-generator.patch", "glib/0009-Unhide-_g_io_modules_ensure_extension_points_registe.patch", 'glib/0014-Don-t-use-AT_FDCWD-on-iOS-for-now.patch', - 'glib/0015-Implementation-of-Cocoa-event-loop-integration-in-GM.patch' + 'glib/0015-Implementation-of-Cocoa-event-loop-integration-in-GM.patch', + 'glib/0020-Include-ntdef.h-for-NTSTATUS.patch' ] files_libs = [ @@ -109,6 +110,7 @@ class Recipe(recipe.Recipe): self.make = '%s private_LDFLAGS=""' % self.make elif self.config.target_platform == Platform.WINDOWS: self.configure_options += ' --with-libiconv=gnu' + self.append_env['CFLAGS'] = ' -DMINGW_HAS_SECURE_API=1 ' elif self.config.target_platform in [Platform.DARWIN, Platform.IOS]: self.files_devel.append(os.path.join('lib', 'glib-2.0', 'include', '*', 'glibconfig.h')) diff --git a/recipes/glib/0020-Include-ntdef.h-for-NTSTATUS.patch b/recipes/glib/0020-Include-ntdef.h-for-NTSTATUS.patch new file mode 100644 index 00000000..80b661e9 --- /dev/null +++ b/recipes/glib/0020-Include-ntdef.h-for-NTSTATUS.patch @@ -0,0 +1,27 @@ +From 70aea6bcd4cf340623435269cbc797adfc84aa8b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com> +Date: Tue, 20 Oct 2015 17:36:33 +0300 +Subject: [PATCH] Include ntdef.h for NTSTATUS + +--- + glib/gwin32.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/glib/gwin32.c b/glib/gwin32.c +index 7781c04..a0cbd1d 100644 +--- a/glib/gwin32.c ++++ b/glib/gwin32.c +@@ -51,6 +51,10 @@ + + #define MODERN_API_FAMILY 2 + ++#if WINAPI_FAMILY != MODERN_API_FAMILY ++# include <ntdef.h> ++#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 */ +-- +2.6.1 + |