From d53b6b858ff939d8dd72364c25aa464d28e7b288 Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Thu, 3 Mar 2022 14:07:48 +0100 Subject: [PATCH] GDK: Avoid using constructors on Win32 The constructors in GDK only have a meaning for UNIX, on Windows they are useless. --- gdk/gdk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gdk/gdk.c b/gdk/gdk.c index f0869a6a81..83672d8f87 100644 --- a/gdk/gdk.c +++ b/gdk/gdk.c @@ -1132,7 +1132,8 @@ gdk_unichar_direction (gunichar ch) return PANGO_DIRECTION_LTR; } -#ifdef G_HAS_CONSTRUCTORS +#if defined (G_HAS_CONSTRUCTORS) && !defined (G_OS_WIN32) +#define GDK_USE_CONSTRUCTORS #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(stash_startup_id) #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(stash_autostart_id) @@ -1175,7 +1176,7 @@ gdk_get_desktop_startup_id (void) if (g_once_init_enter (&init)) { -#ifndef G_HAS_CONSTRUCTORS +#ifndef GDK_USE_CONSTRUCTORS stash_startup_id (); #endif /* Clear the environment variable so it won't be inherited by @@ -1196,7 +1197,7 @@ gdk_get_desktop_autostart_id (void) if (g_once_init_enter (&init)) { -#ifndef G_HAS_CONSTRUCTORS +#ifndef GDK_USE_CONSTRUCTORS stash_autostart_id (); #endif /* Clear the environment variable so it won't be inherited by