[gnome-games] aisleriot: glib 2.8 build fix



commit 28fdedbba236ae21a146a373424c4969ae8e7e85
Author: Christian Persch <chpe gnome org>
Date:   Sat Jul 4 21:30:18 2009 +0200

    aisleriot: glib 2.8 build fix

 aisleriot/game.c   |   18 ++++++++++++++++++
 aisleriot/window.c |    9 +++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/aisleriot/game.c b/aisleriot/game.c
index d3ecd28..648ccfc 100644
--- a/aisleriot/game.c
+++ b/aisleriot/game.c
@@ -253,7 +253,11 @@ clear_slots (AisleriotGame *game,
 #endif /* HAVE_CLUTTER */
     g_byte_array_free (slot->cards, TRUE);
 
+#if GLIB_CHECK_VERSION (2, 10, 0)
     g_slice_free (Slot, slot);
+#else
+    g_free (slot);
+#endif
   }
 
   g_ptr_array_set_size (game->slots, 0);
@@ -597,7 +601,12 @@ cscmi_add_slot (SCM slot_data)
 #undef CHECK_EXPANSION
 
   /* create and initialize slot */
+#if GLIB_CHECK_VERSION (2, 10, 0)
   slot = g_slice_new0 (Slot);
+#else
+  slot = g_new0 (Slot, 1);
+#endif
+
   g_ptr_array_add (game->slots, slot);
 
   slot->id = scm_to_int (SCM_CAR (slot_data));
@@ -2043,7 +2052,11 @@ aisleriot_game_option_free (AisleriotGameOption *option)
   g_return_if_fail (option != NULL);
 
   g_free (option->display_name);
+#if GLIB_CHECK_VERSION (2, 10, 0)
   g_slice_free (AisleriotGameOption, option);
+#else
+  g_free (option);
+#endif
 }
 
 /**
@@ -2100,7 +2113,12 @@ aisleriot_game_get_options (AisleriotGame *game)
 
       entrystate = SCM_NFALSEP (scm_list_ref (entry, scm_from_uint (1)));
 
+#if GLIB_CHECK_VERSION (2, 10, 0)
       option = g_slice_new (AisleriotGameOption);
+#else
+      option = g_new (AisleriotGameOption, 1);
+#endif
+
       option->display_name = g_strdup (entrynamestr);
       option->type = type;
       option->value = bit;
diff --git a/aisleriot/window.c b/aisleriot/window.c
index 2a7f4ba..d314af3 100644
--- a/aisleriot/window.c
+++ b/aisleriot/window.c
@@ -2971,7 +2971,11 @@ free_load_idle_data (LoadIdleData *data)
   data->window->priv->load_idle_id = 0;
 
   g_free (data->game_file);
+#if GLIB_CHECK_VERSION (2, 10, 0)
   g_slice_free (LoadIdleData, data);
+#else
+  g_free (data);
+#endif
 }
 
 /**
@@ -2997,7 +3001,12 @@ aisleriot_window_set_game (AisleriotWindow *window,
     g_source_remove (priv->load_idle_id);
   }
 
+#if GLIB_CHECK_VERSION (2, 10, 0)
   data = g_slice_new (LoadIdleData);
+#else
+  data = g_new (LoadIdleData, 1);
+#endif
+
   data->window = window;
   data->game_file = g_strdup (game_file);
   data->seed = seed;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]