app, modules: Resolve unused Windows variable warnings

This patch adds moves several variables that are not used
on Windows to #ifndef G_OS_WIN32 blocks to prevent
warnings on Windows builds.

(cherry picked from commit e224278517)
This commit is contained in:
Alx Sa 2025-10-12 14:06:04 +00:00 committed by Bruno Lopes
parent 22a9f0edcc
commit d2817317c8
No known key found for this signature in database
4 changed files with 13 additions and 3 deletions

View file

@ -146,7 +146,9 @@ gimp_get_default_language (const gchar *category)
{
gchar *lang;
gchar *p;
#ifndef G_OS_WIN32
gint cat = LC_CTYPE;
#endif
if (! category)
category = "LC_CTYPE";

View file

@ -321,7 +321,9 @@ gimp_eek (const gchar *reason,
! the_errors_gimp->no_interface &&
backtrace_file)
{
#ifndef G_OS_WIN32
FILE *fd;
#endif
gboolean has_backtrace = TRUE;
/* If GUI backtrace enabled (it is disabled by default), it

View file

@ -555,6 +555,10 @@ main (int argc,
GOptionGroup *gimp_group = NULL;
gchar *backtrace_file = NULL;
GError *error = NULL;
#ifdef G_OS_WIN32
gchar *utf8_name;
wchar_t *name;
#endif
#ifndef GIMP_CONSOLE_COMPILATION
GKeyFile *flatpak_keyfile;
#endif
@ -607,8 +611,8 @@ main (int argc,
#ifdef G_OS_WIN32
/* Make Inno aware of gimp process avoiding broken install/unninstall */
char *utf8_name = g_strdup_printf ("GIMP-%s", GIMP_MUTEX_VERSION);
wchar_t *name = g_utf8_to_utf16 (utf8_name, -1, NULL, NULL, NULL);
utf8_name = g_strdup_printf ("GIMP-%s", GIMP_MUTEX_VERSION);
name = g_utf8_to_utf16 (utf8_name, -1, NULL, NULL, NULL);
CreateMutexW (NULL, FALSE, name);
@ -625,8 +629,10 @@ main (int argc,
const gchar *install_dir;
gchar *bin_dir;
LPWSTR w_bin_dir;
#ifdef ENABLE_RELOCATABLE_RESOURCES
size_t path_len;
gchar *path;
#endif
/* On Windows, set DLL search path to $INSTALLDIR/bin so that .exe
* plug-ins processes in the plug-ins directory can find libgimp and

View file

@ -358,7 +358,7 @@ gimp_input_device_store_add (GimpInputDeviceStore *store,
if (UuidToString (guid, &s) != S_OK)
return FALSE;
guidstring = g_strdup (s);
guidstring = g_strdup ((char *) s);
RpcStringFree (&s);
if (FAILED ((hresult = IDirectInput8_CreateDevice (store->directinput8,