[gimp] app: test G_OS_WIN32 rather than G_OS_UNIX for new backtrace feature.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: test G_OS_WIN32 rather than G_OS_UNIX for new backtrace feature.
- Date: Sun, 28 Jan 2018 14:45:16 +0000 (UTC)
commit eab961c9bb3bcf4c50dcbd58ea1758dd9c8acdbf
Author: Jehan <jehan girinstud io>
Date: Fri Jan 26 02:17:13 2018 +0100
app: test G_OS_WIN32 rather than G_OS_UNIX for new backtrace feature.
This is just a bit more consistent with existing code. Also build the
gimpdebug tool only when GIMP_CONSOLE_COMPILATION is not set and run
when --no-interface CLI option is not set since it is a GUI tool.
app/dialogs/preferences-dialog.c | 2 +-
app/errors.c | 8 ++++----
tools/Makefile.am | 6 +++++-
3 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c
index 6fb75a6..cc68095 100644
--- a/app/dialogs/preferences-dialog.c
+++ b/app/dialogs/preferences-dialog.c
@@ -1176,7 +1176,7 @@ prefs_dialog_new (Gimp *gimp,
_("Use OpenCL"),
GTK_BOX (vbox2));
-#ifdef G_OS_UNIX
+#ifndef G_OS_WIN32
vbox2 = prefs_frame_new (_("Debugging"), GTK_CONTAINER (vbox),
FALSE);
diff --git a/app/errors.c b/app/errors.c
index 64e7b30..e194274 100644
--- a/app/errors.c
+++ b/app/errors.c
@@ -277,8 +277,8 @@ gimp_eek (const gchar *reason,
if (use_handler)
{
-#ifdef G_OS_UNIX
- if (generate_backtrace)
+#ifndef GIMP_CONSOLE_COMPILATION
+ if (generate_backtrace && ! the_errors_gimp->no_interface)
{
/* If enabled (it is disabled by default), the GUI preference
* takes precedence over the command line argument.
@@ -355,7 +355,7 @@ static gchar *
gimp_get_stack_trace (void)
{
gchar *trace = NULL;
-#if defined(G_OS_UNIX)
+#ifndef G_OS_WIN32
gchar *args[7] = { "gdb", "-batch", "-ex", "backtrace full",
full_prog_name, NULL, NULL };
gchar *gdb_stdout;
@@ -371,7 +371,7 @@ gimp_get_stack_trace (void)
/* This works only on UNIX systems. On Windows, we'll have to find
* another method, probably with DrMingW.
*/
-#if defined(G_OS_UNIX)
+#ifndef G_OS_WIN32
g_snprintf (pid, 16, "%u", (guint) getpid ());
args[5] = pid;
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 4058774..2be8413 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -14,7 +14,11 @@ gimp_debug_resume_SOURCES = gimp-debug-resume.c
else
-bin_PROGRAMS = gimptool-2.0 gimpdebug-2.0
+bin_PROGRAMS = gimptool-2.0
+
+if !ENABLE_GIMP_CONSOLE
+bin_PROGRAMS += gimpdebug-2.0
+endif
endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]