mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
glib: Don't call MessageBox() when building for UWP
However, it's fine to call it when building for the debug target (which uses the debug CRT and hence sets -D_DEBUG), so let's keep that around. The Windows App Certification Kit only runs on apps built in release mode.
This commit is contained in:
parent
2e2558b313
commit
db3e0c256d
@ -192,9 +192,16 @@ g_on_error_query (const gchar *prg_name)
|
|||||||
if (!prg_name)
|
if (!prg_name)
|
||||||
prg_name = g_get_prgname ();
|
prg_name = g_get_prgname ();
|
||||||
|
|
||||||
|
/* MessageBox is allowed on UWP apps only when building against
|
||||||
|
* the debug CRT, which will set -D_DEBUG */
|
||||||
|
#if defined(_DEBUG) || !defined(G_WINAPI_ONLY_APP)
|
||||||
MessageBox (NULL, "g_on_error_query called, program terminating",
|
MessageBox (NULL, "g_on_error_query called, program terminating",
|
||||||
(prg_name && *prg_name) ? prg_name : NULL,
|
(prg_name && *prg_name) ? prg_name : NULL,
|
||||||
MB_OK|MB_ICONERROR);
|
MB_OK|MB_ICONERROR);
|
||||||
|
#else
|
||||||
|
printf ("g_on_error_query called, program '%s' terminating\n",
|
||||||
|
(prg_name && *prg_name) ? prg_name : "(null)");
|
||||||
|
#endif
|
||||||
_exit(0);
|
_exit(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1358,7 +1358,9 @@ g_logv (const gchar *log_domain,
|
|||||||
|
|
||||||
if ((test_level & G_LOG_FLAG_FATAL) && !masquerade_fatal)
|
if ((test_level & G_LOG_FLAG_FATAL) && !masquerade_fatal)
|
||||||
{
|
{
|
||||||
#ifdef G_OS_WIN32
|
/* MessageBox is allowed on UWP apps only when building against
|
||||||
|
* the debug CRT, which will set -D_DEBUG */
|
||||||
|
#if defined(G_OS_WIN32) && (defined(_DEBUG) || !defined(G_WINAPI_ONLY_APP))
|
||||||
if (win32_keep_fatal_message)
|
if (win32_keep_fatal_message)
|
||||||
{
|
{
|
||||||
gchar *locale_msg = g_locale_from_utf8 (fatal_msg_buf, -1, NULL, NULL, NULL);
|
gchar *locale_msg = g_locale_from_utf8 (fatal_msg_buf, -1, NULL, NULL, NULL);
|
||||||
@ -1366,7 +1368,7 @@ g_logv (const gchar *log_domain,
|
|||||||
MessageBox (NULL, locale_msg, NULL,
|
MessageBox (NULL, locale_msg, NULL,
|
||||||
MB_ICONERROR|MB_SETFOREGROUND);
|
MB_ICONERROR|MB_SETFOREGROUND);
|
||||||
}
|
}
|
||||||
#endif /* !G_OS_WIN32 */
|
#endif
|
||||||
|
|
||||||
_g_log_abort (!(test_level & G_LOG_FLAG_RECURSION));
|
_g_log_abort (!(test_level & G_LOG_FLAG_RECURSION));
|
||||||
}
|
}
|
||||||
@ -2675,7 +2677,9 @@ handled:
|
|||||||
/* Abort if the message was fatal. */
|
/* Abort if the message was fatal. */
|
||||||
if (log_level & G_LOG_FLAG_FATAL)
|
if (log_level & G_LOG_FLAG_FATAL)
|
||||||
{
|
{
|
||||||
#ifdef G_OS_WIN32
|
/* MessageBox is allowed on UWP apps only when building against
|
||||||
|
* the debug CRT, which will set -D_DEBUG */
|
||||||
|
#if defined(G_OS_WIN32) && (defined(_DEBUG) || !defined(G_WINAPI_ONLY_APP))
|
||||||
if (!g_test_initialized ())
|
if (!g_test_initialized ())
|
||||||
{
|
{
|
||||||
gchar *locale_msg = NULL;
|
gchar *locale_msg = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user