From: Alexander Larsson Date: Mon, 5 Mar 2012 14:05:07 +0000 (+0100) Subject: Use G_DEFINE_CONSTRUCTOR for the glib_init constructor X-Git-Tag: 2.31.22~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cf1ad1881c2d8f0cac67d51d3e29713bb28a201;p=platform%2Fupstream%2Fglib.git Use G_DEFINE_CONSTRUCTOR for the glib_init constructor No need to hand-roll this when we have a macro version. --- diff --git a/glib/glib-init.c b/glib/glib-init.c index 5442a97..d5e8242 100644 --- a/glib/glib-init.c +++ b/glib/glib-init.c @@ -24,6 +24,7 @@ #include "glib-init.h" #include "gutils.h" /* for GDebugKey */ +#include "gconstructor.h" #include #include @@ -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 ();