From 0787e82f2b3dad8cea65cfb70b3873fa6eec6fbc Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 11 Nov 2019 18:23:50 +1100 Subject: [PATCH] WIP haiku os support --- src/Core.h | 6 ++++++ src/Logger.c | 2 +- src/Makefile | 6 ++++++ src/Platform.c | 4 ++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Core.h b/src/Core.h index ef2018caf..cc8923991 100644 --- a/src/Core.h +++ b/src/Core.h @@ -202,6 +202,12 @@ typedef struct TextureRec_ { float U1, V1, U2, V2; } TextureRec; #define CC_BUILD_X11 #define CC_BUILD_CURL #define CC_BUILD_OPENAL +#elif defined __HAIKU__ +#define CC_BUILD_HAIKU +#define CC_BUILD_POSIX +#define CC_BUILD_GL +#define CC_BUILD_CURL +#define CC_BUILD_OPENAL #elif defined __EMSCRIPTEN__ #define CC_BUILD_WEB #define CC_BUILD_POSIX diff --git a/src/Logger.c b/src/Logger.c index ada892ef1..32b2d22cc 100644 --- a/src/Logger.c +++ b/src/Logger.c @@ -17,7 +17,7 @@ #define NOIME #include #include -#elif defined CC_BUILD_OPENBSD +#elif defined CC_BUILD_OPENBSD || defined CC_BUILD_HAIKU #include /* OpenBSD doesn't provide sys/ucontext.h */ #elif defined CC_BUILD_LINUX || defined CC_BUILD_ANDROID diff --git a/src/Makefile b/src/Makefile index d441b708f..8ae177e38 100644 --- a/src/Makefile +++ b/src/Makefile @@ -62,6 +62,12 @@ LDFLAGS=-L /usr/X11R7/lib -L /usr/pkg/lib LIBS=-lcurl -lexecinfo -lopenal -lGL -lX11 endif +ifeq ($(PLAT),haiku) +CFLAGS=-w -g -pipe +LDFLAGS=-g +LIBS=-lcurl -lm -lexecinfo -lopenal -lGL +endif + ifeq ($(OS),Windows_NT) DEL=del endif diff --git a/src/Platform.c b/src/Platform.c index ffd36d8e3..94e76314d 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -882,6 +882,10 @@ 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);