mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -27,11 +27,6 @@
|
|||||||
//CAS:#include "gtkalias.h"
|
//CAS:#include "gtkalias.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifndef HAVE_GLIB29
|
|
||||||
static GMemChunk *tree_chunk = NULL;
|
|
||||||
#define TREE_CHUNK_PREALLOCS 64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* node allocation
|
/* node allocation
|
||||||
*/
|
*/
|
||||||
GtkTreeDataList *
|
GtkTreeDataList *
|
||||||
@@ -39,18 +34,7 @@ _gtk_tree_data_list_alloc (void)
|
|||||||
{
|
{
|
||||||
GtkTreeDataList *list;
|
GtkTreeDataList *list;
|
||||||
|
|
||||||
#ifdef HAVE_GLIB29
|
|
||||||
list = g_slice_new0 (GtkTreeDataList);
|
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;
|
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)
|
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);
|
g_boxed_free (column_headers [i], (gpointer) tmp->data.v_pointer);
|
||||||
|
|
||||||
#ifdef HAVE_GLIB29
|
|
||||||
g_slice_free (GtkTreeDataList, tmp);
|
g_slice_free (GtkTreeDataList, tmp);
|
||||||
#else /* !HAVE_GLIB29 */
|
|
||||||
g_mem_chunk_free (tree_chunk, tmp);
|
|
||||||
#endif
|
|
||||||
i++;
|
i++;
|
||||||
tmp = next;
|
tmp = next;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,9 +56,6 @@
|
|||||||
/* Static global variables *****************************************/
|
/* Static global variables *****************************************/
|
||||||
static gboolean guid_initialized = FALSE;
|
static gboolean guid_initialized = FALSE;
|
||||||
static struct md5_ctx guid_context;
|
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. */
|
/* This static indicates the debugging module that this .o belongs to. */
|
||||||
static QofLogModule log_module = QOF_MOD_ENGINE;
|
static QofLogModule log_module = QOF_MOD_ENGINE;
|
||||||
@@ -85,7 +82,6 @@ gnc_value_get_guid (const GValue *value)
|
|||||||
|
|
||||||
|
|
||||||
/* Memory management routines ***************************************/
|
/* Memory management routines ***************************************/
|
||||||
#ifdef HAVE_GLIB29
|
|
||||||
GUID *
|
GUID *
|
||||||
guid_malloc (void)
|
guid_malloc (void)
|
||||||
{
|
{
|
||||||
@@ -100,41 +96,6 @@ guid_free (GUID *guid)
|
|||||||
|
|
||||||
g_slice_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 *
|
GUID *
|
||||||
@@ -510,9 +471,6 @@ guid_init_only_salt(const void *salt, size_t salt_len)
|
|||||||
void
|
void
|
||||||
guid_shutdown (void)
|
guid_shutdown (void)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_GLIB29
|
|
||||||
guid_memchunk_shutdown();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GUID_PERIOD 5000
|
#define GUID_PERIOD 5000
|
||||||
|
|||||||
Reference in New Issue
Block a user