No need to hand-roll this when we have a macro version.
#include "glib-init.h"
#include "gutils.h" /* for GDebugKey */
+#include "gconstructor.h"
#include <string.h>
#include <stdlib.h>
return TRUE;
}
-#elif defined (__GNUC__)
+#elif defined (G_HAS_CONSTRUCTORS)
-__attribute__ ((constructor)) static void
+#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(glib_init_ctor)
+#endif
+G_DEFINE_CONSTRUCTOR(glib_init_ctor)
+
+static void
glib_init_ctor (void)
{
glib_init ();