Build fixes for EL5 after glib 2.12 requirement

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18700 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2010-02-21 00:27:59 +00:00
parent 8c4fa1f762
commit a858e4a48c
2 changed files with 0 additions and 62 deletions

View File

@ -27,11 +27,6 @@
//CAS:#include "gtkalias.h"
#include <string.h>
#ifndef HAVE_GLIB29
static GMemChunk *tree_chunk = NULL;
#define TREE_CHUNK_PREALLOCS 64
#endif
/* node allocation
*/
GtkTreeDataList *
@ -39,18 +34,7 @@ _gtk_tree_data_list_alloc (void)
{
GtkTreeDataList *list;
#ifdef HAVE_GLIB29
list = g_slice_new0 (GtkTreeDataList);
#else /* !HAVE_GLIB29 */
if (tree_chunk == NULL)
tree_chunk = g_mem_chunk_new ("treedatalist mem chunk",
sizeof (GtkTreeDataList),
sizeof (GtkTreeDataList) * TREE_CHUNK_PREALLOCS,
G_ALLOC_AND_FREE);
list = g_chunk_new (GtkTreeDataList, tree_chunk);
memset (list, 0, sizeof (GtkTreeDataList));
#endif
return list;
}
@ -74,11 +58,7 @@ _gtk_tree_data_list_free (GtkTreeDataList *list,
else if (g_type_is_a (column_headers [i], G_TYPE_BOXED) && tmp->data.v_pointer != NULL)
g_boxed_free (column_headers [i], (gpointer) tmp->data.v_pointer);
#ifdef HAVE_GLIB29
g_slice_free (GtkTreeDataList, tmp);
#else /* !HAVE_GLIB29 */
g_mem_chunk_free (tree_chunk, tmp);
#endif
i++;
tmp = next;
}

View File

@ -56,9 +56,6 @@
/* Static global variables *****************************************/
static gboolean guid_initialized = FALSE;
static struct md5_ctx guid_context;
#ifndef HAVE_GLIB29
static GMemChunk *guid_memchunk = NULL;
#endif
/* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = QOF_MOD_ENGINE;
@ -85,7 +82,6 @@ gnc_value_get_guid (const GValue *value)
/* Memory management routines ***************************************/
#ifdef HAVE_GLIB29
GUID *
guid_malloc (void)
{
@ -100,41 +96,6 @@ guid_free (GUID *guid)
g_slice_free(GUID, guid);
}
#else /* !HAVE_GLIB29 */
static void
guid_memchunk_init (void)
{
if (!guid_memchunk)
guid_memchunk = g_mem_chunk_create (GUID, 512, G_ALLOC_AND_FREE);
}
static void
guid_memchunk_shutdown (void)
{
if (guid_memchunk)
{
g_mem_chunk_destroy (guid_memchunk);
guid_memchunk = NULL;
}
}
GUID *
guid_malloc (void)
{
if (!guid_memchunk) guid_memchunk_init();
return g_chunk_new (GUID, guid_memchunk);
}
void
guid_free (GUID *guid)
{
if (!guid)
return;
g_chunk_free (guid, guid_memchunk);
}
#endif
GUID *
@ -510,9 +471,6 @@ guid_init_only_salt(const void *salt, size_t salt_len)
void
guid_shutdown (void)
{
#ifndef HAVE_GLIB29
guid_memchunk_shutdown();
#endif
}
#define GUID_PERIOD 5000