aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ddcutil/execinfo.patch
blob: 99448d70b06a1d43449d0e6dff1685425bf817e1 (plain) (blame)
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
--- ddcutil-0.9.1-clean/src/test/i2c/i2c_io_old.c
+++ ddcutil-0.9.1-patched/src/test/i2c/i2c_io_old.c
@@ -34,7 +34,9 @@
 
 #include <assert.h>
 #include <errno.h>
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
+#endif
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
--- ddcutil-0.9.1-clean/src/util/debug_util.c
+++ ddcutil-0.9.1-patched/src/util/debug_util.c
@@ -26,7 +26,9 @@
  */
 
 /** \cond */
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
+
 #include <glib-2.0/glib.h>
 #include <stdbool.h>
 #include <stdio.h>
@@ -82,7 +84,6 @@
    return result;
 }
 
-
 #ifdef OLD
 /** Show the call stack.
  *
@@ -194,5 +195,5 @@
       g_ptr_array_free(callstack, true);
    }
 }
-
+#endif
 
--- ddcutil-0.9.1-clean/src/util/debug_util.h
+++ ddcutil-0.9.1-patched/src/util/debug_util.h
@@ -30,7 +30,9 @@
 
 #include <glib-2.0/glib.h>
 
+#ifdef HAVE_EXECINFO_H
 GPtrArray * get_backtrace(int stack_adjust);
 void show_backtrace(int stack_adjust);
+#endif
 
 #endif /* DEBUG_UTIL_H_ */

--- ddcutil-0.9.1-clean/src/util/error_info.c
+++ ddcutil-0.9.1-patched/src/util/error_info.c
@@ -101,7 +101,9 @@
    bool debug = false;
    if (debug) {
       printf("(%s) Starting. erec=%p\n", __func__, erec);
+#ifdef HAVE_EXECINFO_H
       show_backtrace(2);
+#endif
    }
    if (erec) {
       VALID_DDC_ERROR_PTR(erec);

--- ddcutil-0.9.1-clean/src/util/edid.h
+++ ddcutil-0.9.1-patched/src/util/edid.h
@@ -36,6 +36,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <sys/types.h>
 /** \endcond */

 #include "coredefs.h"