Builds for Haiku.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4584 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#include <unwind.h>
|
||||
#elif !defined(_WIN32)
|
||||
#elif !defined(_WIN32) && !defined(__HAIKU__)
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
@ -497,9 +497,9 @@ static int _tf_util_backtrace_callback(void* data, uintptr_t pc, const char* fil
|
||||
static void _tf_util_backtrace_error(void* data, const char* message, int error)
|
||||
{
|
||||
char** stack = data;
|
||||
int length = strlen(message);
|
||||
if (message)
|
||||
{
|
||||
int length = strlen(message);
|
||||
int current = *stack ? strlen(*stack) : 0;
|
||||
*stack = tf_resize_vec(*stack, current + length + 1);
|
||||
memcpy(*stack + current, message, length + 1);
|
||||
@ -587,6 +587,8 @@ int tf_util_backtrace(void** buffer, int count)
|
||||
android_backtrace_t state = { .current = buffer, .end = buffer + count };
|
||||
_Unwind_Backtrace(_android_unwind_callback, &state);
|
||||
return state.current - buffer;
|
||||
#elif defined(__HAIKU__)
|
||||
return 0;
|
||||
#else
|
||||
return backtrace(buffer, count);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user