From e3be556728831b03b448819741f2c1c69f939294 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Tue, 4 Oct 2011 16:52:03 -0400 Subject: [PATCH] end the glib-ctor experiment This was a bad approach. We attempt to handle initailisation in a more centralised way now. --- glib/Makefile.am | 1 - glib/glib-ctor.h | 25 ------------------------- glib/gmem.c | 2 -- 3 files changed, 28 deletions(-) delete mode 100644 glib/glib-ctor.h diff --git a/glib/Makefile.am b/glib/Makefile.am index c65cbc92e..012ab0860 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -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 \ diff --git a/glib/glib-ctor.h b/glib/glib-ctor.h deleted file mode 100644 index 7b299f97b..000000000 --- a/glib/glib-ctor.h +++ /dev/null @@ -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__ */ diff --git a/glib/gmem.c b/glib/gmem.c index 15aee8123..488bff869 100644 --- a/glib/gmem.c +++ b/glib/gmem.c @@ -43,8 +43,6 @@ #include "gtestutils.h" #include "gthread.h" #include "glib_trace.h" -#include "glib-ctor.h" - #define MEM_PROFILE_TABLE_SIZE 4096