1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
commit c009c4c1800086e7f4c4e80939e9ddc8964c8e12
Author: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
Date: Thu Aug 4 00:27:08 2022 +0200
Include execinfo.h only if available
Bug: https://bugs.gentoo.org/873016
Upstream: https://gitlab.com/free-astro/siril/-/merge_requests/284
Bug: https://bugs.gentoo.org/898108
Upstream: https://gitlab.com/free-astro/siril/-/merge_requests/442
diff --git a/src/core/signals.c b/src/core/signals.c
index 74100b3a..0eefd460 100644
--- a/src/core/signals.c
+++ b/src/core/signals.c
@@ -25,7 +25,7 @@
#ifdef _WIN32
#include <windows.h>
#include <dbghelp.h>
-#else
+#elif HAVE_EXECINFO_H
#include <execinfo.h>
#endif
commit 13bafd227500018bef052cad1d73e9c681be1b8a
Author: Cyril Richard <cyril.richard42@gmail.com>
Date: Thu Aug 4 11:29:23 2022 +0200
Fix for merge_requests/284
Bug: https://bugs.gentoo.org/883121
Upstream: https://gitlab.com/free-astro/siril/-/commit/13bafd227500018bef052cad1d73e9c681be1b8a
diff --git a/src/core/signals.c b/src/core/signals.c
index 0eefd460..bbce5fa7 100644
--- a/src/core/signals.c
+++ b/src/core/signals.c
@@ -21,6 +21,9 @@
#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>
From 6f959a02d27fb507cda1898a3aa785766e77d404 Mon Sep 17 00:00:00 2001
From: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
Date: Mon, 27 Feb 2023 17:34:43 +0100
Subject: [PATCH] fix HAVE_EXECINFO_H logic
---
src/core/signals.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/core/signals.c b/src/core/signals.c
index 42b369d6..d4745909 100644
--- a/src/core/signals.c
+++ b/src/core/signals.c
@@ -55,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;
@@ -84,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();
--
2.39.2
|