aports/testing/juce/execinfo-compat.patch
2026-04-13 21:58:53 +01:00

40 lines
953 B
Diff

--- /dev/null
+++ b/modules/juce_core/juce_core/execinfo.h
@@ -0,0 +1,36 @@
+#pragma once
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if defined(__has_include)
+ #if __has_include(<elfutils/libdwfl.h>)
+ #endif
+#endif
+#ifndef _EXECINFO_H
+#define _EXECINFO_H 1
+int backtrace(void **buffer, int size) __attribute__((weak));
+char **backtrace_symbols(void *const *buffer, int size) __attribute__((weak));
+void backtrace_symbols_fd(void *const *buffer, int size, int fd) __attribute__((weak));
+
+__attribute__((weak))
+int backtrace(void **buffer, int size) {
+ (void)buffer; (void)size;
+ return 0;
+}
+
+__attribute__((weak))
+char **backtrace_symbols(void *const *buffer, int size) {
+ (void)buffer; (void)size;
+ return (char**)0;
+}
+
+__attribute__((weak))
+void backtrace_symbols_fd(void *const *buffer, int size, int fd) {
+ (void)buffer; (void)size; (void)fd;
+}
+
+#endif /* _EXECINFO_H */
+
+#ifdef __cplusplus
+}
+#endif
+