From be3c56d91a5faf6ce2692d359c77181826d015ae Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 12 Nov 2019 07:51:40 +1100 Subject: [PATCH] Now launcher window shows on haiku os although I cheated and used SDL to do it --- src/Logger.c | 13 +++++++++++++ src/Makefile | 2 +- src/Platform.c | 10 ++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/Logger.c b/src/Logger.c index 32b2d22cc..604505f6b 100644 --- a/src/Logger.c +++ b/src/Logger.c @@ -584,6 +584,19 @@ static void Logger_PrintRegisters(String* str, void* ctx) { #error "Unknown CPU architecture" #endif } +#elif defined CC_BUILD_HAIKU +static void Logger_PrintRegisters(String* str, void* ctx) { + mcontext_t r = ((ucontext_t*)ctx)->uc_mcontext; +#if defined __i386__ + #define REG_GET(reg, ign) &r.me##reg + Logger_Dump_X86() +#elif defined __x86_64__ + #define REG_GET(reg, ign) &r.r##reg + Logger_Dump_X64() +#else + #error "Unknown CPU architecture" +#endif +} #endif static void Logger_DumpRegisters(void* ctx) { String str; char strBuffer[768]; diff --git a/src/Makefile b/src/Makefile index f4c4cecd2..8774173de 100644 --- a/src/Makefile +++ b/src/Makefile @@ -65,7 +65,7 @@ endif ifeq ($(PLAT),haiku) CFLAGS=-w -g -pipe LDFLAGS=-g -LIBS=-lcurl -lm -lexecinfo -lopenal -lGL +LIBS=-lcurl -lm -lexecinfo -lopenal -lGL -lnetwork endif ifeq ($(OS),Windows_NT) diff --git a/src/Platform.c b/src/Platform.c index 3d8a59c74..28f399db4 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -91,6 +91,8 @@ const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK; #include #include #elif defined CC_BUILD_HAIKU +#define CC_BUILD_HAIKU +/* TODO: Use open instead of xdg-open */ #include #elif defined CC_BUILD_WEB #include @@ -874,6 +876,10 @@ void Platform_LoadSysFonts(void) { String_FromConst("/usr/pkg/lib/X11/fonts"), String_FromConst("/usr/pkg/share/fonts") }; +#elif defined CC_BUILD_HAIKU + static const String dirs[1] = { + String_FromConst("/system/data/fonts") + }; #elif defined CC_BUILD_UNIX static const String dirs[2] = { String_FromConst("/usr/share/fonts"), @@ -884,10 +890,6 @@ void Platform_LoadSysFonts(void) { String_FromConst("/System/Library/Fonts"), String_FromConst("/Library/Fonts") }; -#elif defined CC_BUILD_HAIKU - static const String dirs[1] = { - String_FromConst("/system/data/fonts") - }; #endif for (i = 0; i < Array_Elems(dirs); i++) { Directory_Enum(&dirs[i], NULL, FontDirCallback);