forked from osmocom/wireshark
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.
This commit is contained in:
parent
66bd99f1a8
commit
7c156d9ac4
|
@ -32,6 +32,7 @@ if(WIN32)
|
||||||
message(STATUS "Using 3rd party repository")
|
message(STATUS "Using 3rd party repository")
|
||||||
endif()
|
endif()
|
||||||
set(USE_MSYSTEM ${_msystem} CACHE INTERNAL "Use MSYS2 subsystem")
|
set(USE_MSYSTEM ${_msystem} CACHE INTERNAL "Use MSYS2 subsystem")
|
||||||
|
set(HAVE_MSYSTEM ${USE_MSYSTEM}) # For config.h
|
||||||
set(USE_REPOSITORY ${_repository} CACHE INTERNAL "Use Wireshark 3rd Party Repository")
|
set(USE_REPOSITORY ${_repository} CACHE INTERNAL "Use Wireshark 3rd Party Repository")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -309,6 +309,9 @@
|
||||||
/* Define to 1 if the 'ssize_t' type exists. */
|
/* Define to 1 if the 'ssize_t' type exists. */
|
||||||
#cmakedefine HAVE_SSIZE_T 1
|
#cmakedefine HAVE_SSIZE_T 1
|
||||||
|
|
||||||
|
/* Define to 1 if we are using the msys2 environment to build. */
|
||||||
|
#cmakedefine HAVE_MSYSTEM 1
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
# define strncasecmp strnicmp
|
# define strncasecmp strnicmp
|
||||||
# define popen _popen
|
# define popen _popen
|
||||||
|
|
|
@ -342,7 +342,7 @@ check_and_warn_user_startup()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(__MINGW64__)
|
#if defined(_WIN32) && !defined(HAVE_MSYSTEM)
|
||||||
// Try to avoid library search path collisions. QCoreApplication will
|
// Try to avoid library search path collisions. QCoreApplication will
|
||||||
// search QT_INSTALL_PREFIX/plugins for platform DLLs before searching
|
// search QT_INSTALL_PREFIX/plugins for platform DLLs before searching
|
||||||
// the application directory. If
|
// the application directory. If
|
||||||
|
@ -650,7 +650,7 @@ int main(int argc, char *qt_argv[])
|
||||||
|
|
||||||
commandline_early_options(argc, argv);
|
commandline_early_options(argc, argv);
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(__MINGW64__)
|
#if defined(_WIN32) && !defined(HAVE_MSYSTEM)
|
||||||
win32_reset_library_path();
|
win32_reset_library_path();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -642,7 +642,7 @@ configuration_init_w32(const char* arg0 _U_)
|
||||||
msg, error);
|
msg, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __MINGW64__
|
#ifdef HAVE_MSYSTEM
|
||||||
/*
|
/*
|
||||||
* We already have the program_dir. Find the installation prefix.
|
* We already have the program_dir. Find the installation prefix.
|
||||||
* This is one level up from the bin_dir. If the program_dir does
|
* 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);
|
install_prefix = g_strdup(progfile_dir);
|
||||||
running_in_build_directory_flag = TRUE;
|
running_in_build_directory_flag = TRUE;
|
||||||
}
|
}
|
||||||
#endif /* __MINGW64__ */
|
#endif /* HAVE_MSYSTEM */
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -994,7 +994,7 @@ get_datafile_dir(void)
|
||||||
return datafile_dir;
|
return datafile_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__MINGW64__)
|
#if defined(HAVE_MSYSTEM)
|
||||||
if (running_in_build_directory_flag) {
|
if (running_in_build_directory_flag) {
|
||||||
datafile_dir = g_strdup(install_prefix);
|
datafile_dir = g_strdup(install_prefix);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1072,7 +1072,7 @@ get_doc_dir(void)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__MINGW64__)
|
#if defined(HAVE_MSYSTEM)
|
||||||
if (running_in_build_directory_flag) {
|
if (running_in_build_directory_flag) {
|
||||||
doc_dir = g_strdup(install_prefix);
|
doc_dir = g_strdup(install_prefix);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1157,7 +1157,7 @@ init_plugin_dir(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_PLUGINS) || defined(HAVE_LUA)
|
#if defined(HAVE_PLUGINS) || defined(HAVE_LUA)
|
||||||
#if defined(__MINGW64__)
|
#if defined(HAVE_MSYSTEM)
|
||||||
if (running_in_build_directory_flag) {
|
if (running_in_build_directory_flag) {
|
||||||
plugin_dir = g_build_filename(install_prefix, "plugins", (gchar *)NULL);
|
plugin_dir = g_build_filename(install_prefix, "plugins", (gchar *)NULL);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1311,7 +1311,7 @@ init_extcap_dir(void)
|
||||||
extcap_dir = g_strdup(g_getenv(extcap_dir_envar));
|
extcap_dir = g_strdup(g_getenv(extcap_dir_envar));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__MINGW64__)
|
#if defined(HAVE_MSYSTEM)
|
||||||
else if (running_in_build_directory_flag) {
|
else if (running_in_build_directory_flag) {
|
||||||
extcap_dir = g_build_filename(install_prefix, "extcap", (gchar *)NULL);
|
extcap_dir = g_build_filename(install_prefix, "extcap", (gchar *)NULL);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue