aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2023-02-06 16:09:54 +0000
committerJoão Valverde <j@v6e.pt>2023-02-06 19:39:33 +0000
commit7c156d9ac4264672984252e351e8e0fe753838af (patch)
tree11111dbef397b7a2bafb227efbc41b7ecf8cbe95 /wsutil
parent66bd99f1a837473bf250ed48e127516c2d838f44 (diff)
Add a #define HAVE_MSYSTEM and use it
In certain situations using __MINGW64__ is not correct. We want to have the condition apply using MinGW-w64 but also using MSYS2, which the __MINGW64__ condition alone does not capture. Add a HAVE_MSYSTEM C define and use it where appropriate.
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/filesystem.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c
index 79052de219..909aecd86e 100644
--- a/wsutil/filesystem.c
+++ b/wsutil/filesystem.c
@@ -642,7 +642,7 @@ configuration_init_w32(const char* arg0 _U_)
msg, error);
}
-#ifdef __MINGW64__
+#ifdef HAVE_MSYSTEM
/*
* We already have the program_dir. Find the installation prefix.
* This is one level up from the bin_dir. If the program_dir does
@@ -657,7 +657,7 @@ configuration_init_w32(const char* arg0 _U_)
install_prefix = g_strdup(progfile_dir);
running_in_build_directory_flag = TRUE;
}
-#endif /* __MINGW64__ */
+#endif /* HAVE_MSYSTEM */
return NULL;
}
@@ -994,7 +994,7 @@ get_datafile_dir(void)
return datafile_dir;
}
-#if defined(__MINGW64__)
+#if defined(HAVE_MSYSTEM)
if (running_in_build_directory_flag) {
datafile_dir = g_strdup(install_prefix);
} else {
@@ -1072,7 +1072,7 @@ get_doc_dir(void)
;
}
-#if defined(__MINGW64__)
+#if defined(HAVE_MSYSTEM)
if (running_in_build_directory_flag) {
doc_dir = g_strdup(install_prefix);
} else {
@@ -1157,7 +1157,7 @@ init_plugin_dir(void)
}
#if defined(HAVE_PLUGINS) || defined(HAVE_LUA)
-#if defined(__MINGW64__)
+#if defined(HAVE_MSYSTEM)
if (running_in_build_directory_flag) {
plugin_dir = g_build_filename(install_prefix, "plugins", (gchar *)NULL);
} else {
@@ -1311,7 +1311,7 @@ init_extcap_dir(void)
extcap_dir = g_strdup(g_getenv(extcap_dir_envar));
}
-#if defined(__MINGW64__)
+#if defined(HAVE_MSYSTEM)
else if (running_in_build_directory_flag) {
extcap_dir = g_build_filename(install_prefix, "extcap", (gchar *)NULL);
} else {