mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
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:
parent
a970fddb0e
commit
3cf1ad1881
@ -24,6 +24,7 @@
|
|||||||
#include "glib-init.h"
|
#include "glib-init.h"
|
||||||
|
|
||||||
#include "gutils.h" /* for GDebugKey */
|
#include "gutils.h" /* for GDebugKey */
|
||||||
|
#include "gconstructor.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -246,9 +247,14 @@ DllMain (HINSTANCE hinstDLL,
|
|||||||
return TRUE;
|
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_ctor (void)
|
||||||
{
|
{
|
||||||
glib_init ();
|
glib_init ();
|
||||||
|
Loading…
Reference in New Issue
Block a user