void-packages/srcpkgs/ddcutil/patches/musl.patch

49 lines
1.1 KiB
Diff

--- src/util/debug_util.c.orig 2017-11-16 07:13:16.000000000 +0100
+++ src/util/debug_util.c 2017-11-18 21:39:20.788717791 +0100
@@ -26,7 +26,10 @@
*/
/** \cond */
+#include <features.h>
+#ifdef __GLIBC__
#include <execinfo.h>
+#endif
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -89,16 +92,22 @@
if (debug)
printf("(%s) Starting. stack_adjust = %d\n", __func__, stack_adjust);
- int j, nptrs;
+ int j, nptrs = 0;
+#ifdef __GLIBC__
const int MAX_ADDRS = 100;
void *buffer[MAX_ADDRS];
- char **strings;
+#endif
+ char **strings = NULL;
+#ifdef __GLIBC__
nptrs = backtrace(buffer, MAX_ADDRS);
+#endif
if (debug)
printf("(%s) backtrace() returned %d addresses\n", __func__, nptrs);
+#ifdef __GLIBC__
strings = backtrace_symbols(buffer, nptrs);
+#endif
if (strings == NULL) {
perror("backtrace_symbols unavailable");
}
--- src/util/edid.h.orig 2017-11-16 07:13:16.000000000 +0100
+++ src/util/edid.h 2017-11-17 21:29:05.725854175 +0100
@@ -36,6 +36,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
/** \endcond */
#include "coredefs.h"