Commit cfaaec63 authored by Luca Bacci's avatar Luca Bacci Committed by Jehan
Browse files

Use ExcHndlSetLogFileNameW ()

This is a Dr.MinGW function
parent 11801cf4
......@@ -51,9 +51,12 @@ static void gimp_sigfatal_handler (gint sig_num) G_GNUC_NORETURN;
void
gimp_init_signal_handlers (gchar **backtrace_file)
{
time_t t;
gchar *filename;
gchar *dir;
time_t t;
gchar *filename;
gchar *dir;
#if defined (G_OS_WIN32) && defined (HAVE_EXCHNDL)
wchar_t *backtrace_file_utf16;
#endif
#ifdef G_OS_WIN32
/* This has to be the non-roaming directory (i.e., the local
......@@ -92,7 +95,12 @@ gimp_init_signal_handlers (gchar **backtrace_file)
g_prevExceptionFilter = SetUnhandledExceptionFilter (gimp_sigfatal_handler);
ExcHndlInit ();
ExcHndlSetLogFileNameA (*backtrace_file);
if ((backtrace_file_utf16 = g_utf8_to_utf16 (*backtrace_file, -1, NULL, NULL, NULL)))
{
ExcHndlSetLogFileNameW (backtrace_file_utf16);
g_free (backtrace_file_utf16);
}
#endif /* HAVE_EXCHNDL */
......
......@@ -959,7 +959,7 @@ AC_MSG_RESULT([$with_win32_32bit_dll_folder])
enable_drmingw="no"
if test "x$platform_win32" = "xyes"; then
# Check for Dr. Mingw
AC_CHECK_LIB(exchndl, ExcHndlSetLogFileNameA,
AC_CHECK_LIB(exchndl, ExcHndlSetLogFileNameW,
[
AC_DEFINE(HAVE_EXCHNDL, 1, [Define to 1 when Dr. MingW is available])
LIBS="-lexchndl $LIBS"
......@@ -968,7 +968,7 @@ if test "x$platform_win32" = "xyes"; then
[enable_drmingw="no (ExcHndl library missing)"]
)
fi
AM_CONDITIONAL(HAVE_EXCHNDL, test "x$ac_cv_lib_exchndl_ExcHndlSetLogFileNameA" = "xyes")
AM_CONDITIONAL(HAVE_EXCHNDL, test "x$ac_cv_lib_exchndl_ExcHndlSetLogFileNameW" = "xyes")
###########################
# Check for backtrace() API
......
......@@ -224,9 +224,10 @@ gimp_main (GType plug_in_type,
#ifdef HAVE_EXCHNDL
/* Use Dr. Mingw (dumps backtrace on crash) if it is available. */
{
time_t t;
gchar *filename;
gchar *dir;
time_t t;
gchar *filename;
gchar *dir;
wchar_t *plug_in_backtrace_path_utf16;
/* This has to be the non-roaming directory (i.e., the local
* directory) as backtraces correspond to the binaries on this
......@@ -252,7 +253,14 @@ gimp_main (GType plug_in_type,
_prevExceptionFilter = SetUnhandledExceptionFilter (gimp_plugin_sigfatal_handler);
ExcHndlInit ();
ExcHndlSetLogFileNameA (plug_in_backtrace_path);
plug_in_backtrace_path_utf16 = g_utf8_to_utf16 (plug_in_backtrace_path,
-1, NULL, NULL, NULL);
if (plug_in_backtrace_path_utf16)
{
ExcHndlSetLogFileNameW (plug_in_backtrace_path_utf16);
g_free (plug_in_backtrace_path_utf16);
}
}
#endif /* HAVE_EXCHNDL */
......
......@@ -578,7 +578,7 @@ conf.set('HAVE_LIBUNWIND', libunwind.found())
drmingw = no_dep
if platform_windows
exchndl = cc.find_library('exchndl', required: false)
exchndl_fn = cc.has_function('ExcHndlSetLogFileNameA', dependencies: exchndl)
exchndl_fn = cc.has_function('ExcHndlSetLogFileNameW', dependencies: exchndl)
if exchndl.found() and exchndl_fn
drmingw = declare_dependency(dependencies: exchndl)
endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment