[gnumeric] win32: update to latest glib
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] win32: update to latest glib
- Date: Sat, 20 Dec 2014 22:45:39 +0000 (UTC)
commit 965a9705bc97e77efc5d74e2ae1fd20b62e99f37
Author: Morten Welinder <terra gnome org>
Date: Sat Dec 20 17:45:14 2014 -0500
win32: update to latest glib
tools/win32/moduleset.in | 4 +-
.../glib-goption-disable-localization.patch | 233 +++++++------------
tools/win32/patches/glib-rand.patch | 31 ++--
3 files changed, 105 insertions(+), 163 deletions(-)
---
diff --git a/tools/win32/moduleset.in b/tools/win32/moduleset.in
index 3519421..33cf55a 100644
--- a/tools/win32/moduleset.in
+++ b/tools/win32/moduleset.in
@@ -68,11 +68,11 @@
</autotools>
<autotools id="glib">
- <branch repo="gnome.org" module="sources/glib/2.41/glib-2.41.3.tar.xz" version="2.41.3">
+ <branch repo="gnome.org" module="sources/glib/2.43/glib-2.43.2.tar.xz" version="2.43.2">
<patch file="&patch_dir;glib-win32-cachefile.patch.gz"/>
<patch file="&patch_dir;glib-goption-disable-localization.patch" strip="1"/>
<patch file="&patch_dir;glib-gspawn-win32.patch" strip="1"/>
- <patch file="&patch_dir;glib-appinfo.patch" strip="1"/>
+ <!-- <patch file="&patch_dir;glib-appinfo.patch" strip="1"/> -->
<patch file="&patch_dir;glib-gatomic.patch" strip="1"/>
<patch file="&patch_dir;glib-dns.patch" strip="1"/>
<patch file="&patch_dir;glib-rand.patch" strip="1"/>
diff --git a/tools/win32/patches/glib-goption-disable-localization.patch
b/tools/win32/patches/glib-goption-disable-localization.patch
index 5685a12..ef7ec35 100644
--- a/tools/win32/patches/glib-goption-disable-localization.patch
+++ b/tools/win32/patches/glib-goption-disable-localization.patch
@@ -1,148 +1,87 @@
-diff -ur glib-2.26.0/glib/goption.c glib-2.26.0-new/glib/goption.c
---- glib-2.26.0/glib/goption.c 2010-07-07 16:57:11.000000000 -0400
-+++ glib-2.26.0-new/glib/goption.c 2010-10-05 18:59:03.000000000 -0400
-***************
-*** 248,253 ****
---- 248,254 ----
- guint help_enabled : 1;
- guint ignore_unknown : 1;
- guint strv_mode : 1;
-+ guint delocalize : 1;
-
- GOptionGroup *main_group;
-
-***************
-*** 360,365 ****
---- 361,367 ----
- context->parameter_string = g_strdup (parameter_string);
- context->help_enabled = TRUE;
- context->ignore_unknown = FALSE;
-+ context->delocalize = TRUE;
-
- return context;
- }
-***************
-*** 483,488 ****
---- 485,507 ----
- return context->ignore_unknown;
- }
-
-+ void
-+ g_option_context_set_delocalize (GOptionContext *context,
-+ gboolean delocalize)
-+ {
-+ g_return_if_fail (context != NULL);
-+
-+ context->delocalize = delocalize;
-+ }
-+
-+ gboolean
-+ g_option_context_get_delocalize (GOptionContext *context)
-+ {
-+ g_return_val_if_fail (context != NULL, FALSE);
-+
-+ return context->delocalize;
-+ }
-+
- /**
- * g_option_context_add_group:
- * @context: a #GOptionContext
-***************
-*** 1199,1205 ****
- gchar *data;
-
- #ifdef G_OS_WIN32
-! if (!context->strv_mode)
- data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
- else
- data = g_strdup (value);
---- 1218,1224 ----
- gchar *data;
-
- #ifdef G_OS_WIN32
-! if (!context->strv_mode && context->delocalize)
- data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
- else
- data = g_strdup (value);
-***************
-*** 1225,1231 ****
- gchar *data;
-
- #ifdef G_OS_WIN32
-! if (!context->strv_mode)
- data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
- else
- data = g_strdup (value);
---- 1244,1250 ----
- gchar *data;
-
- #ifdef G_OS_WIN32
-! if (!context->strv_mode && context->delocalize)
- data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
- else
- data = g_strdup (value);
-***************
-*** 1264,1270 ****
- gchar *data;
-
- #ifdef G_OS_WIN32
-! if (!context->strv_mode)
- data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
- else
- data = g_strdup (value);
---- 1283,1289 ----
- gchar *data;
-
- #ifdef G_OS_WIN32
-! if (!context->strv_mode && context->delocalize)
- data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
- else
- data = g_strdup (value);
-***************
-*** 1290,1296 ****
- gchar *data;
-
- #ifdef G_OS_WIN32
-! if (!context->strv_mode)
- data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
- else
- data = g_strdup (value);
---- 1309,1315 ----
- gchar *data;
-
- #ifdef G_OS_WIN32
-! if (!context->strv_mode && context->delocalize)
- data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
- else
- data = g_strdup (value);
-***************
-*** 1350,1356 ****
- else if (entry->flags & G_OPTION_FLAG_FILENAME)
- {
- #ifdef G_OS_WIN32
-! if (!context->strv_mode)
- data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
- else
- data = g_strdup (value);
---- 1369,1375 ----
- else if (entry->flags & G_OPTION_FLAG_FILENAME)
- {
- #ifdef G_OS_WIN32
-! if (!context->strv_mode && context->delocalize)
- data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
- else
- data = g_strdup (value);
-
-diff -ur glib-2.26.0/glib/goption.h glib-2.26.0-new/glib/goption.h
---- glib-2.26.0/glib/goption.h 2010-07-07 16:57:11.000000000 -0400
-+++ glib-2.26.0-new/glib/goption.h 2010-10-05 18:59:03.000000000 -0400
-@@ -321,6 +321,9 @@
- void g_option_context_set_ignore_unknown_options (GOptionContext *context,
- gboolean ignore_unknown);
- gboolean g_option_context_get_ignore_unknown_options (GOptionContext *context);
-+GLIB_AVAILABLE_IN_ALL void g_option_context_set_delocalize (GOptionContext *context,
-+ gboolean ignore_unknown);
-+GLIB_AVAILABLE_IN_ALL gboolean g_option_context_get_delocalize (GOptionContext *context);
+--- glib-2.43.2/glib/goption.c.orig 2014-12-14 17:46:52.000000000 -0500
++++ glib-2.43.2/glib/goption.c 2014-12-20 16:55:23.957576969 -0500
+@@ -249,6 +249,7 @@
+ guint ignore_unknown : 1;
+ guint strv_mode : 1;
+ guint strict_posix : 1;
++ guint delocalize : 1;
- void g_option_context_add_main_entries (GOptionContext *context,
- const GOptionEntry *entries,
+ GOptionGroup *main_group;
+
+@@ -362,6 +363,7 @@
+ context->strict_posix = FALSE;
+ context->help_enabled = TRUE;
+ context->ignore_unknown = FALSE;
++ context->delocalize = TRUE;
+
+ return context;
+ }
+@@ -546,6 +548,23 @@
+ return context->strict_posix;
+ }
+
++void
++g_option_context_set_delocalize (GOptionContext *context,
++ gboolean delocalize)
++{
++ g_return_if_fail (context != NULL);
++
++ context->delocalize = delocalize;
++}
++
++gboolean
++g_option_context_get_delocalize (GOptionContext *context)
++{
++ g_return_val_if_fail (context != NULL, FALSE);
++
++ return context->delocalize;
++}
++
+ /**
+ * g_option_context_add_group:
+ * @context: a #GOptionContext
+@@ -1262,7 +1281,7 @@
+ gchar *data;
+
+ #ifdef G_OS_WIN32
+- if (!context->strv_mode)
++ if (!context->strv_mode && context->delocalize)
+ data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
+ else
+ data = g_strdup (value);
+@@ -1288,7 +1307,7 @@
+ gchar *data;
+
+ #ifdef G_OS_WIN32
+- if (!context->strv_mode)
++ if (!context->strv_mode && context->delocalize)
+ data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
+ else
+ data = g_strdup (value);
+@@ -1327,7 +1346,7 @@
+ gchar *data;
+
+ #ifdef G_OS_WIN32
+- if (!context->strv_mode)
++ if (!context->strv_mode && context->delocalize)
+ data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
+ else
+ data = g_strdup (value);
+@@ -1353,7 +1372,7 @@
+ gchar *data;
+
+ #ifdef G_OS_WIN32
+- if (!context->strv_mode)
++ if (!context->strv_mode && context->delocalize)
+ data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
+ else
+ data = g_strdup (value);
+@@ -1413,7 +1432,7 @@
+ else if (entry->flags & G_OPTION_FLAG_FILENAME)
+ {
+ #ifdef G_OS_WIN32
+- if (!context->strv_mode)
++ if (!context->strv_mode && context->delocalize)
+ data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
+ else
+ data = g_strdup (value);
diff --git a/tools/win32/patches/glib-rand.patch b/tools/win32/patches/glib-rand.patch
index 88481b7..c6c4ee2 100644
--- a/tools/win32/patches/glib-rand.patch
+++ b/tools/win32/patches/glib-rand.patch
@@ -1,22 +1,20 @@
---- glib-2.39.2/glib/grand.c~ 2013-11-23 09:58:07.000000000 -0500
-+++ glib-2.39.2/glib/grand.c 2013-12-25 17:51:07.000000000 -0500
-@@ -57,6 +57,7 @@
+--- glib-2.43.2/glib/grand.c.orig 2014-09-15 15:51:01.000000000 -0400
++++ glib-2.43.2/glib/grand.c 2014-12-20 17:42:06.754659718 -0500
+@@ -55,6 +55,7 @@
#endif
#ifdef G_OS_WIN32
+#include <windows.h>
#include <stdlib.h>
+ #include <process.h> /* For getpid() */
#endif
-
-@@ -264,10 +265,33 @@
- seed[3] = getppid ();
- }
- #else /* G_OS_WIN32 */
-- gint i;
+@@ -269,14 +270,32 @@
+ for (i = 0; i < G_N_ELEMENTS (seed); i++)
+ rand_s (&seed[i]);
+ #else
+-#warning Using insecure seed for random number generation because of missing rand_s() in Windows XP
+- GTimeVal now;
+ static BOOLEAN (* g_RtlGenRandom) (PVOID RandomBuffer, ULONG RandomBufferLength);
-
-- for (i = 0; i < G_N_ELEMENTS (seed); i++)
-- rand_s (&seed[i]);
+ if (g_once_init_enter (&g_RtlGenRandom))
+ {
+ /* See
@@ -40,8 +38,13 @@
+
+ g_once_init_leave (&g_RtlGenRandom, func);
+ }
-+
+
+- g_get_current_time (&now);
+- seed[0] = now.tv_sec;
+- seed[1] = now.tv_usec;
+- seed[2] = getpid ();
+- seed[3] = 0;
+ (* g_RtlGenRandom) (seed, sizeof seed);
#endif
- return g_rand_new_with_seed_array (seed, 4);
+ #endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]