mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 22:52:09 +01:00
Use a MessageBox for fatal messages. Collect eror message into a buffer,
2000-12-25 Tor Lillqvist <tml@iki.fi> * gmessages.c: (Win32) Use a MessageBox for fatal messages. Collect eror message into a buffer, and display that. * glib.def: Update. * glibconfig.h.win32.in: Update. Remove unused wchar and wctype macros, add G_MODULE_SUFFIX.
This commit is contained in:
parent
855e230f31
commit
7a19b4cae9
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2000-12-25 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gmessages.c: (Win32) Use a MessageBox for fatal
|
||||||
|
messages. Collect eror message into a buffer, and display that.
|
||||||
|
|
||||||
|
* glib.def: Update.
|
||||||
|
|
||||||
|
* glibconfig.h.win32.in: Update. Remove unused wchar and wctype
|
||||||
|
macros, add G_MODULE_SUFFIX.
|
||||||
|
|
||||||
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
||||||
|
|
||||||
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2000-12-25 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gmessages.c: (Win32) Use a MessageBox for fatal
|
||||||
|
messages. Collect eror message into a buffer, and display that.
|
||||||
|
|
||||||
|
* glib.def: Update.
|
||||||
|
|
||||||
|
* glibconfig.h.win32.in: Update. Remove unused wchar and wctype
|
||||||
|
macros, add G_MODULE_SUFFIX.
|
||||||
|
|
||||||
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
||||||
|
|
||||||
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2000-12-25 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gmessages.c: (Win32) Use a MessageBox for fatal
|
||||||
|
messages. Collect eror message into a buffer, and display that.
|
||||||
|
|
||||||
|
* glib.def: Update.
|
||||||
|
|
||||||
|
* glibconfig.h.win32.in: Update. Remove unused wchar and wctype
|
||||||
|
macros, add G_MODULE_SUFFIX.
|
||||||
|
|
||||||
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
||||||
|
|
||||||
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2000-12-25 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gmessages.c: (Win32) Use a MessageBox for fatal
|
||||||
|
messages. Collect eror message into a buffer, and display that.
|
||||||
|
|
||||||
|
* glib.def: Update.
|
||||||
|
|
||||||
|
* glibconfig.h.win32.in: Update. Remove unused wchar and wctype
|
||||||
|
macros, add G_MODULE_SUFFIX.
|
||||||
|
|
||||||
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
||||||
|
|
||||||
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2000-12-25 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gmessages.c: (Win32) Use a MessageBox for fatal
|
||||||
|
messages. Collect eror message into a buffer, and display that.
|
||||||
|
|
||||||
|
* glib.def: Update.
|
||||||
|
|
||||||
|
* glibconfig.h.win32.in: Update. Remove unused wchar and wctype
|
||||||
|
macros, add G_MODULE_SUFFIX.
|
||||||
|
|
||||||
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
||||||
|
|
||||||
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2000-12-25 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gmessages.c: (Win32) Use a MessageBox for fatal
|
||||||
|
messages. Collect eror message into a buffer, and display that.
|
||||||
|
|
||||||
|
* glib.def: Update.
|
||||||
|
|
||||||
|
* glibconfig.h.win32.in: Update. Remove unused wchar and wctype
|
||||||
|
macros, add G_MODULE_SUFFIX.
|
||||||
|
|
||||||
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
||||||
|
|
||||||
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2000-12-25 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gmessages.c: (Win32) Use a MessageBox for fatal
|
||||||
|
messages. Collect eror message into a buffer, and display that.
|
||||||
|
|
||||||
|
* glib.def: Update.
|
||||||
|
|
||||||
|
* glibconfig.h.win32.in: Update. Remove unused wchar and wctype
|
||||||
|
macros, add G_MODULE_SUFFIX.
|
||||||
|
|
||||||
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
||||||
|
|
||||||
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2000-12-25 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* gmessages.c: (Win32) Use a MessageBox for fatal
|
||||||
|
messages. Collect eror message into a buffer, and display that.
|
||||||
|
|
||||||
|
* glib.def: Update.
|
||||||
|
|
||||||
|
* glibconfig.h.win32.in: Update. Remove unused wchar and wctype
|
||||||
|
macros, add G_MODULE_SUFFIX.
|
||||||
|
|
||||||
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
2000-12-24 Ali Abdin <aliabdin@aucegypt.edu>
|
||||||
|
|
||||||
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
* Makefile.am, gcompat.h, glib.h: New gcompat.h header file
|
||||||
|
26
glib.def
26
glib.def
@ -54,17 +54,21 @@ EXPORTS
|
|||||||
g_date_add_years
|
g_date_add_years
|
||||||
g_date_clear
|
g_date_clear
|
||||||
g_date_compare
|
g_date_compare
|
||||||
g_date_day
|
|
||||||
g_date_day_of_year
|
|
||||||
g_date_days_in_month
|
|
||||||
g_date_free
|
g_date_free
|
||||||
|
g_date_get_day
|
||||||
|
g_date_get_day_of_year
|
||||||
|
g_date_get_days_in_month
|
||||||
|
g_date_get_julian
|
||||||
|
g_date_get_monday_week_of_year
|
||||||
|
g_date_get_monday_weeks_in_year
|
||||||
|
g_date_get_month
|
||||||
|
g_date_get_sunday_week_of_year
|
||||||
|
g_date_get_sunday_weeks_in_year
|
||||||
|
g_date_get_weekday
|
||||||
|
g_date_get_year
|
||||||
g_date_is_first_of_month
|
g_date_is_first_of_month
|
||||||
g_date_is_last_of_month
|
g_date_is_last_of_month
|
||||||
g_date_is_leap_year
|
g_date_is_leap_year
|
||||||
g_date_julian
|
|
||||||
g_date_monday_week_of_year
|
|
||||||
g_date_monday_weeks_in_year
|
|
||||||
g_date_month
|
|
||||||
g_date_new
|
g_date_new
|
||||||
g_date_new_dmy
|
g_date_new_dmy
|
||||||
g_date_new_julian
|
g_date_new_julian
|
||||||
@ -79,8 +83,6 @@ EXPORTS
|
|||||||
g_date_subtract_days
|
g_date_subtract_days
|
||||||
g_date_subtract_months
|
g_date_subtract_months
|
||||||
g_date_subtract_years
|
g_date_subtract_years
|
||||||
g_date_sunday_week_of_year
|
|
||||||
g_date_sunday_weeks_in_year
|
|
||||||
g_date_to_struct_tm
|
g_date_to_struct_tm
|
||||||
g_date_valid
|
g_date_valid
|
||||||
g_date_valid_day
|
g_date_valid_day
|
||||||
@ -89,8 +91,6 @@ EXPORTS
|
|||||||
g_date_valid_month
|
g_date_valid_month
|
||||||
g_date_valid_weekday
|
g_date_valid_weekday
|
||||||
g_date_valid_year
|
g_date_valid_year
|
||||||
g_date_weekday
|
|
||||||
g_date_year
|
|
||||||
g_direct_equal
|
g_direct_equal
|
||||||
g_direct_hash
|
g_direct_hash
|
||||||
g_dirname
|
g_dirname
|
||||||
@ -102,8 +102,8 @@ EXPORTS
|
|||||||
g_file_error_from_errno
|
g_file_error_from_errno
|
||||||
g_file_error_quark
|
g_file_error_quark
|
||||||
g_file_get_contents
|
g_file_get_contents
|
||||||
g_file_test
|
|
||||||
g_file_open_tmp
|
g_file_open_tmp
|
||||||
|
g_file_test
|
||||||
g_filename_from_utf8
|
g_filename_from_utf8
|
||||||
g_filename_to_utf8
|
g_filename_to_utf8
|
||||||
g_free
|
g_free
|
||||||
@ -456,9 +456,9 @@ EXPORTS
|
|||||||
g_strdelimit
|
g_strdelimit
|
||||||
g_strdown
|
g_strdown
|
||||||
g_strdup
|
g_strdup
|
||||||
g_strdupv
|
|
||||||
g_strdup_printf
|
g_strdup_printf
|
||||||
g_strdup_vprintf
|
g_strdup_vprintf
|
||||||
|
g_strdupv
|
||||||
g_strerror
|
g_strerror
|
||||||
g_strescape
|
g_strescape
|
||||||
g_strfreev
|
g_strfreev
|
||||||
|
@ -54,17 +54,21 @@ EXPORTS
|
|||||||
g_date_add_years
|
g_date_add_years
|
||||||
g_date_clear
|
g_date_clear
|
||||||
g_date_compare
|
g_date_compare
|
||||||
g_date_day
|
|
||||||
g_date_day_of_year
|
|
||||||
g_date_days_in_month
|
|
||||||
g_date_free
|
g_date_free
|
||||||
|
g_date_get_day
|
||||||
|
g_date_get_day_of_year
|
||||||
|
g_date_get_days_in_month
|
||||||
|
g_date_get_julian
|
||||||
|
g_date_get_monday_week_of_year
|
||||||
|
g_date_get_monday_weeks_in_year
|
||||||
|
g_date_get_month
|
||||||
|
g_date_get_sunday_week_of_year
|
||||||
|
g_date_get_sunday_weeks_in_year
|
||||||
|
g_date_get_weekday
|
||||||
|
g_date_get_year
|
||||||
g_date_is_first_of_month
|
g_date_is_first_of_month
|
||||||
g_date_is_last_of_month
|
g_date_is_last_of_month
|
||||||
g_date_is_leap_year
|
g_date_is_leap_year
|
||||||
g_date_julian
|
|
||||||
g_date_monday_week_of_year
|
|
||||||
g_date_monday_weeks_in_year
|
|
||||||
g_date_month
|
|
||||||
g_date_new
|
g_date_new
|
||||||
g_date_new_dmy
|
g_date_new_dmy
|
||||||
g_date_new_julian
|
g_date_new_julian
|
||||||
@ -79,8 +83,6 @@ EXPORTS
|
|||||||
g_date_subtract_days
|
g_date_subtract_days
|
||||||
g_date_subtract_months
|
g_date_subtract_months
|
||||||
g_date_subtract_years
|
g_date_subtract_years
|
||||||
g_date_sunday_week_of_year
|
|
||||||
g_date_sunday_weeks_in_year
|
|
||||||
g_date_to_struct_tm
|
g_date_to_struct_tm
|
||||||
g_date_valid
|
g_date_valid
|
||||||
g_date_valid_day
|
g_date_valid_day
|
||||||
@ -89,8 +91,6 @@ EXPORTS
|
|||||||
g_date_valid_month
|
g_date_valid_month
|
||||||
g_date_valid_weekday
|
g_date_valid_weekday
|
||||||
g_date_valid_year
|
g_date_valid_year
|
||||||
g_date_weekday
|
|
||||||
g_date_year
|
|
||||||
g_direct_equal
|
g_direct_equal
|
||||||
g_direct_hash
|
g_direct_hash
|
||||||
g_dirname
|
g_dirname
|
||||||
@ -102,8 +102,8 @@ EXPORTS
|
|||||||
g_file_error_from_errno
|
g_file_error_from_errno
|
||||||
g_file_error_quark
|
g_file_error_quark
|
||||||
g_file_get_contents
|
g_file_get_contents
|
||||||
g_file_test
|
|
||||||
g_file_open_tmp
|
g_file_open_tmp
|
||||||
|
g_file_test
|
||||||
g_filename_from_utf8
|
g_filename_from_utf8
|
||||||
g_filename_to_utf8
|
g_filename_to_utf8
|
||||||
g_free
|
g_free
|
||||||
@ -456,9 +456,9 @@ EXPORTS
|
|||||||
g_strdelimit
|
g_strdelimit
|
||||||
g_strdown
|
g_strdown
|
||||||
g_strdup
|
g_strdup
|
||||||
g_strdupv
|
|
||||||
g_strdup_printf
|
g_strdup_printf
|
||||||
g_strdup_vprintf
|
g_strdup_vprintf
|
||||||
|
g_strdupv
|
||||||
g_strerror
|
g_strerror
|
||||||
g_strescape
|
g_strescape
|
||||||
g_strfreev
|
g_strfreev
|
||||||
|
@ -95,6 +95,14 @@ static GPrivate* g_log_depth = NULL;
|
|||||||
|
|
||||||
static gboolean alloc_console_called = FALSE;
|
static gboolean alloc_console_called = FALSE;
|
||||||
|
|
||||||
|
static gboolean gonna_abort = FALSE;
|
||||||
|
|
||||||
|
/* This default message will usually be overwritten. */
|
||||||
|
/* Yes, a fixed size buffer is bad. So sue me. But g_error is never
|
||||||
|
* with huge strings, is it? */
|
||||||
|
static char fatal_msg_buf[1000] = "Unspecified fatal error encountered, aborting.";
|
||||||
|
static char *fatal_msg_ptr = fatal_msg_buf;
|
||||||
|
|
||||||
/* Just use stdio. If we're out of memory, we're hosed anyway. */
|
/* Just use stdio. If we're out of memory, we're hosed anyway. */
|
||||||
#undef write
|
#undef write
|
||||||
static inline int
|
static inline int
|
||||||
@ -102,6 +110,14 @@ dowrite (FILE *fd,
|
|||||||
const void *buf,
|
const void *buf,
|
||||||
unsigned int len)
|
unsigned int len)
|
||||||
{
|
{
|
||||||
|
if (gonna_abort)
|
||||||
|
{
|
||||||
|
memcpy (fatal_msg_ptr, buf, len);
|
||||||
|
fatal_msg_ptr += len;
|
||||||
|
*fatal_msg_ptr = 0;
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
fwrite (buf, len, 1, fd);
|
fwrite (buf, len, 1, fd);
|
||||||
fflush (fd);
|
fflush (fd);
|
||||||
|
|
||||||
@ -115,6 +131,9 @@ ensure_stdout_valid (void)
|
|||||||
{
|
{
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
|
|
||||||
|
if (gonna_abort)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!alloc_console_called)
|
if (!alloc_console_called)
|
||||||
{
|
{
|
||||||
handle = GetStdHandle (STD_OUTPUT_HANDLE);
|
handle = GetStdHandle (STD_OUTPUT_HANDLE);
|
||||||
@ -413,6 +432,9 @@ g_logv (const gchar *log_domain,
|
|||||||
else
|
else
|
||||||
abort ();
|
abort ();
|
||||||
#else /* !G_ENABLE_DEBUG || !SIGTRAP */
|
#else /* !G_ENABLE_DEBUG || !SIGTRAP */
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
MessageBox (NULL, fatal_msg_buf, NULL, MB_OK);
|
||||||
|
#endif
|
||||||
abort ();
|
abort ();
|
||||||
#endif /* !G_ENABLE_DEBUG || !SIGTRAP */
|
#endif /* !G_ENABLE_DEBUG || !SIGTRAP */
|
||||||
}
|
}
|
||||||
@ -473,6 +495,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
* DOS prompt.
|
* DOS prompt.
|
||||||
*/
|
*/
|
||||||
fd = stdout;
|
fd = stdout;
|
||||||
|
gonna_abort = is_fatal;
|
||||||
#else
|
#else
|
||||||
fd = (log_level > G_LOG_LEVEL_MESSAGE) ? 1 : 2;
|
fd = (log_level > G_LOG_LEVEL_MESSAGE) ? 1 : 2;
|
||||||
#endif
|
#endif
|
||||||
|
@ -193,8 +193,7 @@ union _GSystemThread
|
|||||||
#define GLIB_SYSDEF_POLLHUP = 16
|
#define GLIB_SYSDEF_POLLHUP = 16
|
||||||
#define GLIB_SYSDEF_POLLNVAL = 32
|
#define GLIB_SYSDEF_POLLNVAL = 32
|
||||||
|
|
||||||
#define G_HAVE_WCHAR_H 1
|
#define G_MODULE_SUFFIX "dll"
|
||||||
#define G_HAVE_WCTYPE_H 1
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
23
gmessages.c
23
gmessages.c
@ -95,6 +95,14 @@ static GPrivate* g_log_depth = NULL;
|
|||||||
|
|
||||||
static gboolean alloc_console_called = FALSE;
|
static gboolean alloc_console_called = FALSE;
|
||||||
|
|
||||||
|
static gboolean gonna_abort = FALSE;
|
||||||
|
|
||||||
|
/* This default message will usually be overwritten. */
|
||||||
|
/* Yes, a fixed size buffer is bad. So sue me. But g_error is never
|
||||||
|
* with huge strings, is it? */
|
||||||
|
static char fatal_msg_buf[1000] = "Unspecified fatal error encountered, aborting.";
|
||||||
|
static char *fatal_msg_ptr = fatal_msg_buf;
|
||||||
|
|
||||||
/* Just use stdio. If we're out of memory, we're hosed anyway. */
|
/* Just use stdio. If we're out of memory, we're hosed anyway. */
|
||||||
#undef write
|
#undef write
|
||||||
static inline int
|
static inline int
|
||||||
@ -102,6 +110,14 @@ dowrite (FILE *fd,
|
|||||||
const void *buf,
|
const void *buf,
|
||||||
unsigned int len)
|
unsigned int len)
|
||||||
{
|
{
|
||||||
|
if (gonna_abort)
|
||||||
|
{
|
||||||
|
memcpy (fatal_msg_ptr, buf, len);
|
||||||
|
fatal_msg_ptr += len;
|
||||||
|
*fatal_msg_ptr = 0;
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
fwrite (buf, len, 1, fd);
|
fwrite (buf, len, 1, fd);
|
||||||
fflush (fd);
|
fflush (fd);
|
||||||
|
|
||||||
@ -115,6 +131,9 @@ ensure_stdout_valid (void)
|
|||||||
{
|
{
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
|
|
||||||
|
if (gonna_abort)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!alloc_console_called)
|
if (!alloc_console_called)
|
||||||
{
|
{
|
||||||
handle = GetStdHandle (STD_OUTPUT_HANDLE);
|
handle = GetStdHandle (STD_OUTPUT_HANDLE);
|
||||||
@ -413,6 +432,9 @@ g_logv (const gchar *log_domain,
|
|||||||
else
|
else
|
||||||
abort ();
|
abort ();
|
||||||
#else /* !G_ENABLE_DEBUG || !SIGTRAP */
|
#else /* !G_ENABLE_DEBUG || !SIGTRAP */
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
MessageBox (NULL, fatal_msg_buf, NULL, MB_OK);
|
||||||
|
#endif
|
||||||
abort ();
|
abort ();
|
||||||
#endif /* !G_ENABLE_DEBUG || !SIGTRAP */
|
#endif /* !G_ENABLE_DEBUG || !SIGTRAP */
|
||||||
}
|
}
|
||||||
@ -473,6 +495,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
* DOS prompt.
|
* DOS prompt.
|
||||||
*/
|
*/
|
||||||
fd = stdout;
|
fd = stdout;
|
||||||
|
gonna_abort = is_fatal;
|
||||||
#else
|
#else
|
||||||
fd = (log_level > G_LOG_LEVEL_MESSAGE) ? 1 : 2;
|
fd = (log_level > G_LOG_LEVEL_MESSAGE) ? 1 : 2;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user