end the glib-ctor experiment
authorRyan Lortie <desrt@desrt.ca>
Tue, 4 Oct 2011 20:52:03 +0000 (16:52 -0400)
committerRyan Lortie <desrt@desrt.ca>
Tue, 4 Oct 2011 21:32:53 +0000 (17:32 -0400)
This was a bad approach.  We attempt to handle initailisation in a more
centralised way now.

glib/Makefile.am
glib/glib-ctor.h [deleted file]
glib/gmem.c

index c65cbc9..012ab08 100644 (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          \
diff --git a/glib/glib-ctor.h b/glib/glib-ctor.h
deleted file mode 100644 (file)
index 7b299f9..0000000
+++ /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__ */
index 15aee81..488bff8 100644 (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