end the glib-ctor experiment

This was a bad approach.  We attempt to handle initailisation in a more
centralised way now.
This commit is contained in:
Ryan Lortie 2011-10-04 16:52:03 -04:00
parent bb5d90a768
commit e3be556728
3 changed files with 0 additions and 28 deletions

View File

@ -149,7 +149,6 @@ libglib_2_0_la_SOURCES = \
gkeyfile.c \
glibintl.h \
glib_trace.h \
glib-ctor.h \
glib-init.h \
glib-init.c \
glib-private.h \

View File

@ -1,25 +0,0 @@
#ifndef __GLIB_CTOR_H__
#if defined (__GNUC__) && !defined (_WIN32)
#define GLIB_CTOR(func) \
__attribute__((constructor)) static void func (void)
#define GLIB_ENSURE_CTOR(func) G_STMT_START { } G_STMT_END
#else
/* could be vastly improved... */
#define GLIB_CTOR(func) \
static GMutex g__##func##_mutex; \
static gboolean g__##func##_initialised; \
static void func (void)
#define GLIB_ENSURE_CTOR(func) \
G_STMT_START { \
g_mutex_lock (&g__##func##_mutex); \
if (!g__##func##_initialised) \
{ \
g__##func##_initialised = TRUE; \
func (); \
} \
g_mutex_unlock (&g__##func##_mutex); \
} G_STMT_END
#endif
#endif /* __GLIB_CTOR_H__ */

View File

@ -43,8 +43,6 @@
#include "gtestutils.h"
#include "gthread.h"
#include "glib_trace.h"
#include "glib-ctor.h"
#define MEM_PROFILE_TABLE_SIZE 4096