[mingw-glib2] Fix build on Windows (upstream commit 9cb5385)

Erik van Pienbroek epienbro at fedoraproject.org
Sat Mar 1 13:48:23 UTC 2014


commit e531c1c3f4af96684eb93e397efa7f54965a3502
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Sat Mar 1 14:49:16 2014 +0100

    Fix build on Windows (upstream commit 9cb5385)

 glib-commit-9cb5385.patch |   38 ++++++++++++++++++++++++++++++++++++++
 mingw-glib2.spec          |    4 ++++
 2 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/glib-commit-9cb5385.patch b/glib-commit-9cb5385.patch
new file mode 100644
index 0000000..edeae52
--- /dev/null
+++ b/glib-commit-9cb5385.patch
@@ -0,0 +1,38 @@
+From 9cb53851be2d90c804e6f31da26a11c51329f33c Mon Sep 17 00:00:00 2001
+From: Chun-wei Fan <fanchunwei at src.gnome.org>
+Date: Wed, 19 Feb 2014 05:57:18 +0000
+Subject: gio/gresolver.c: Fix build on Windows
+
+Windows does not come with inet_aton(), and this check on IPv4 addresses
+is actually not needed on Windows as the getaddrinfo() implementation on
+Windows already rejects non-standard and non-real IPv4 numbers-and-dots
+addresses.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=724609
+---
+diff --git a/gio/gresolver.c b/gio/gresolver.c
+index 730ac1b..78d079a 100644
+--- a/gio/gresolver.c
++++ b/gio/gresolver.c
+@@ -308,8 +308,10 @@ handle_ip_address (const char  *hostname,
+   /* Reject non-standard IPv4 numbers-and-dots addresses.
+    * g_inet_address_new_from_string() will have accepted any "real" IP
+    * address, so if inet_aton() succeeds, then it's an address we want
+-   * to reject.
++   * to reject.  This check is not necessary for Windows, as getaddrinfo()
++   * already rejects such IPv4 addresses on Windows.
+    */
++#ifndef G_OS_WIN32
+   if (inet_aton (hostname, &ip4addr))
+     {
+       g_set_error (error, G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND,
+@@ -317,6 +319,7 @@ handle_ip_address (const char  *hostname,
+                    hostname, gai_strerror (EAI_NONAME));
+       return TRUE;
+     }
++#endif
+ 
+   return FALSE;
+ }
+--
+cgit v0.9.2
diff --git a/mingw-glib2.spec b/mingw-glib2.spec
index 42f6946..d1b866d 100644
--- a/mingw-glib2.spec
+++ b/mingw-glib2.spec
@@ -53,6 +53,9 @@ Patch3:         glib-send-log-messages-to-correct-stdout-and-stderr.patch
 # https://bugzilla.gnome.org/show_bug.cgi?id=698118
 Patch5:         glib-prefer-constructors-over-DllMain.patch
 
+# Fix build on Windows
+Patch6:         glib-commit-9cb5385.patch
+
 
 %description
 MinGW Windows Glib2 library.
@@ -98,6 +101,7 @@ Static version of the MinGW Windows GLib2 library.
 %patch1 -p1
 %patch3 -p0
 %patch5 -p1
+%patch6 -p1
 
 
 %build


More information about the scm-commits mailing list