aports/testing/siril/siril-fix-execinfo.patch
duckl1ng b891cab3d2 testing/siril: new aport
https://siril.org
Siril is an astronomical image processing tool
2023-06-01 13:08:04 +02:00

59 lines
1.6 KiB
Diff

Patch-Source: https://gitlab.com/free-astro/siril/-/commit/9c63d74841826f9949c808bcc857300d8b52cc3b
diff --git a/src/core/signals.c b/src/core/signals.c
index 74100b3a..d4745909 100644
--- a/src/core/signals.c
+++ b/src/core/signals.c
@@ -1,7 +1,7 @@
/*
* This file is part of Siril, an astronomy image processor.
* Copyright (C) 2005-2011 Francois Meyer (dulle at free.fr)
- * Copyright (C) 2012-2022 team free-astro (see more in AUTHORS file)
+ * Copyright (C) 2012-2023 team free-astro (see more in AUTHORS file)
* Reference site is https://free-astro.org/index.php/Siril
*
* Siril is free software: you can redistribute it and/or modify
@@ -21,11 +21,14 @@
#define ANSI_COLOR_RED "\e[1m\x1b[31m"
#define ANSI_COLOR_RESET "\x1b[0m\e[0m"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <signal.h>
#ifdef _WIN32
#include <windows.h>
#include <dbghelp.h>
-#else
+#elif HAVE_EXECINFO_H
#include <execinfo.h>
#endif
@@ -52,13 +55,7 @@ static void signal_handled(int s) {
g_printf(ANSI_COLOR_RED"%s"ANSI_COLOR_RESET"\n", visit);
}
-#if (!defined _WIN32 && defined HAVE_EXECINFO_H)
- void *stack[STACK_DEPTH];
-
- size_t size = backtrace(stack, sizeof(stack) / sizeof(void*));
-
- backtrace_symbols_fd(stack, size, fileno((FILE*) stdout));
-#else
+#ifdef _WIN32
unsigned int i;
void *stack[STACK_DEPTH];
unsigned short size;
@@ -81,6 +78,12 @@ static void signal_handled(int s) {
}
free(symbol);
+#elif HAVE_EXECINFO_H
+ void *stack[STACK_DEPTH];
+
+ size_t size = backtrace(stack, sizeof(stack) / sizeof(void*));
+
+ backtrace_symbols_fd(stack, size, fileno((FILE*) stdout));
#endif
}
undo_flush();