Use G_DEFINE_CONSTRUCTOR for the glib_init constructor

No need to hand-roll this when we have a macro version.
This commit is contained in:
Alexander Larsson 2012-03-05 15:05:07 +01:00
parent a970fddb0e
commit 3cf1ad1881

View File

@ -24,6 +24,7 @@
#include "glib-init.h"
#include "gutils.h" /* for GDebugKey */
#include "gconstructor.h"
#include <string.h>
#include <stdlib.h>
@ -246,9 +247,14 @@ DllMain (HINSTANCE hinstDLL,
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 ();