diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-04-14 14:51:58 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-04-14 14:51:58 +0300 |
commit | 47042e51329d2df68cb90d820b13b16259ac80c0 (patch) | |
tree | d225aedc8e90ecd8524b7e0f2e2aca450755d523 /recipes/glib | |
parent | 8361035b46bc892a24afd3a5e525d672894956f1 (diff) |
glib: Fix crash on Windows caused by storing GTypes in a long
long is 32 bits on Win64, GType 64 bits.
https://bugzilla.gnome.org/show_bug.cgi?id=758738
Diffstat (limited to 'recipes/glib')
-rw-r--r-- | recipes/glib/0016-gparamspecs-GTypes-are-stored-in-v_pointer-not-v_lon.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/recipes/glib/0016-gparamspecs-GTypes-are-stored-in-v_pointer-not-v_lon.patch b/recipes/glib/0016-gparamspecs-GTypes-are-stored-in-v_pointer-not-v_lon.patch new file mode 100644 index 00000000..4acb026d --- /dev/null +++ b/recipes/glib/0016-gparamspecs-GTypes-are-stored-in-v_pointer-not-v_lon.patch @@ -0,0 +1,55 @@ +From 34b13946942d7e9e7e05513e6a82547836adf5fd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com> +Date: Thu, 14 Apr 2016 14:40:04 +0300 +Subject: [PATCH] gparamspecs: GTypes are stored in v_pointer, not v_long + +v_long is 32 bits on Win64, v_pointer is 64 bits. On most other platforms the +size of long and pointer is the same, so it's usually not a problem. + +https://bugzilla.gnome.org/show_bug.cgi?id=758738 +--- + gobject/gparamspecs.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/gobject/gparamspecs.c b/gobject/gparamspecs.c +index 16c1f55..43fc383 100644 +--- a/gobject/gparamspecs.c ++++ b/gobject/gparamspecs.c +@@ -1067,7 +1067,7 @@ param_gtype_set_default (GParamSpec *pspec, + { + GParamSpecGType *tspec = G_PARAM_SPEC_GTYPE (pspec); + +- value->data[0].v_long = tspec->is_a_type; ++ value->data[0].v_pointer = GSIZE_TO_POINTER (tspec->is_a_type); + } + + static gboolean +@@ -1075,12 +1075,12 @@ param_gtype_validate (GParamSpec *pspec, + GValue *value) + { + GParamSpecGType *tspec = G_PARAM_SPEC_GTYPE (pspec); +- GType gtype = value->data[0].v_long; ++ GType gtype = GPOINTER_TO_SIZE (value->data[0].v_pointer); + guint changed = 0; + + if (tspec->is_a_type != G_TYPE_NONE && !g_type_is_a (gtype, tspec->is_a_type)) + { +- value->data[0].v_long = tspec->is_a_type; ++ value->data[0].v_pointer = GSIZE_TO_POINTER (tspec->is_a_type); + changed++; + } + +@@ -1092,8 +1092,8 @@ param_gtype_values_cmp (GParamSpec *pspec, + const GValue *value1, + const GValue *value2) + { +- GType p1 = value1->data[0].v_long; +- GType p2 = value2->data[0].v_long; ++ GType p1 = GPOINTER_TO_SIZE (value1->data[0].v_pointer); ++ GType p2 = GPOINTER_TO_SIZE (value2->data[0].v_pointer); + + /* not much to compare here, try to at least provide stable lesser/greater result */ + +-- +2.8.0.rc3 + |