From b308ed6fff234687d0849e60f88915b172b73eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= Date: Sun, 25 Feb 2018 11:10:26 +0100 Subject: Haiku supporting patches diff --git a/Common.mak b/Common.mak index 5bc9aa5..0474ead 100644 --- a/Common.mak +++ b/Common.mak @@ -33,6 +33,8 @@ ifndef HOSTPLATFORM HOSTPLATFORM := DARWIN else ifeq ($(findstring BeOS,$(uname)),BeOS) HOSTPLATFORM := BEOS + else ifeq ($(findstring Haiku,$(uname)),Haiku) + HOSTPLATFORM=HAIKU else ifeq ($(findstring skyos,$(uname)),skyos) HOSTPLATFORM := SKYOS else ifeq ($(findstring QNX,$(uname)),QNX) @@ -969,17 +971,22 @@ else ifeq ($(SUBPLATFORM),LINUX) LIBS += -lrt endif -ifeq (,$(filter $(PLATFORM),WINDOWS WII)) - ifneq ($(PLATFORM),BSD) - LIBS += -ldl - endif - ifneq ($(PLATFORM),DARWIN) - LIBS += -pthread +ifneq ($(PLATFORM),HAIKU) + ifeq (,$(filter $(PLATFORM),WINDOWS WII)) + ifneq ($(PLATFORM),BSD) + LIBS += -ldl + endif + ifneq ($(PLATFORM),DARWIN) + LIBS += -pthread + endif endif endif LIBS += -lm +ifeq ($(PLATFORM),HAIKU) + LIBS+= -lnetwork +endif ##### Detect version control revision, if applicable diff --git a/GNUmakefile b/GNUmakefile index c0e9af3..1767008 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -655,6 +655,10 @@ ifeq ($(PLATFORM),BSD) LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lexecinfo endif +ifeq ($(PLATFORM),HAIKU) + LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lexecinfo -lnetwork +endif + ifeq ($(PLATFORM),DARWIN) LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm \ -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \ diff --git a/source/build/include/compat.h b/source/build/include/compat.h index 4d3d90a..543c295 100644 --- a/source/build/include/compat.h +++ b/source/build/include/compat.h @@ -342,7 +342,7 @@ defined __x86_64__ || defined __amd64__ || defined _M_X64 || defined _M_IA64 || # endif # include -#elif defined(__BEOS__) +#elif defined(__BEOS__) || defined(__HAIKU__) # include # if LITTLE_ENDIAN != 0 # define B_LITTLE_ENDIAN 1 diff --git a/source/build/src/kplib.cpp b/source/build/src/kplib.cpp index 78aaca2..3c51680 100644 --- a/source/build/src/kplib.cpp +++ b/source/build/src/kplib.cpp @@ -34,6 +34,10 @@ credits. #include "kplib.h" #include "pragmas.h" +#ifdef __HAIKU__ +#include +#endif + #include "vfs.h" #if !defined(_WIN32) @@ -2752,14 +2756,14 @@ int32_t kzfindfile(char *filnam) if ((findata = readdir(hfind)) == NULL) { closedir(hfind); hfind = NULL; if (!kzhashbuf) return 0; srchstat = 2; break; } i = wildstpathleng; - if (findata->d_type == DT_DIR) - { if (findata->d_name[0] == '.' && !findata->d_name[1]) continue; } //skip . - else if ((findata->d_type == DT_REG) || (findata->d_type == DT_LNK)) - { if (findata->d_name[0] == '.') continue; } //skip hidden (dot) files - else continue; //skip devices and fifos and such - if (!wildmatch(findata->d_name,&newildst[wildstpathleng])) continue; - strcpy(&filnam[i],findata->d_name); - if (findata->d_type == DT_DIR) strcat(&filnam[i],"/"); +// if (findata->d_type == DT_DIR) +// { if (findata->d_name[0] == '.' && !findata->d_name[1]) continue; } //skip . +// else if ((findata->d_type == DT_REG) || (findata->d_type == DT_LNK)) +// { if (findata->d_name[0] == '.') continue; } //skip hidden (dot) files +// else continue; //skip devices and fifos and such +// if (!wildmatch(findata->d_name,&newildst[wildstpathleng])) continue; +// strcpy(&filnam[i],findata->d_name); +// if (findata->d_type == DT_DIR) strcat(&filnam[i],"/"); #endif return 1; } diff --git a/source/duke3d/src/common.cpp b/source/duke3d/src/common.cpp index 3482893..d55e695 100644 --- a/source/duke3d/src/common.cpp +++ b/source/duke3d/src/common.cpp @@ -327,6 +327,8 @@ void G_ExtInit(void) APPNAME #elif defined(GEKKO) "apps/" APPBASENAME +#elif defined(__HAIKU__) + "config/settings/" APPBASENAME #else ".config/" APPBASENAME #endif -- 2.19.1