Merge branch 'backport-3589-msvc-prototypes-glib-2-78' into 'glib-2-78'

Backport !3589 “gconstructor.h: Ensure [c|d]tor prototypes are present for MSVC” to glib-2-78

See merge request GNOME/glib!3604
This commit is contained in:
Philip Withnall 2023-10-03 09:47:45 +00:00
commit ca1949a45a

View File

@ -95,6 +95,7 @@
#define G_MSVC_CTOR(_func,_sym_prefix) \
static void _func(void); \
extern int (* _array ## _func)(void); \
int _func ## _wrapper(void); \
int _func ## _wrapper(void) { _func(); g_slist_find (NULL, _array ## _func); return 0; } \
__pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \
__pragma(section(".CRT$XCU",read)) \
@ -103,6 +104,7 @@
#define G_MSVC_DTOR(_func,_sym_prefix) \
static void _func(void); \
extern int (* _array ## _func)(void); \
int _func ## _constructor(void); \
int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL, _array ## _func); return 0; } \
__pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \
__pragma(section(".CRT$XCU",read)) \