From b1b414fc4a8da20e37918e87c8bd174ef27c608c Mon Sep 17 00:00:00 2001
From: Julius Enriquez <win8linux@gmail.com>
Date: Wed, 20 Oct 2021 18:19:35 +0000
Subject: [PATCH] Fix Haiku support in i_system.c

---
 src/sdl/i_system.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c
index 2ec28ebc82..be8928abec 100644
--- a/src/sdl/i_system.c
+++ b/src/sdl/i_system.c
@@ -137,21 +137,23 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
 #include <errno.h>
 #endif
 
-#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
+#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
 #include <execinfo.h>
 #include <time.h>
 #define UNIXBACKTRACE
 #endif
 
 // Locations for searching the srb2.pk3
-#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
+#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) || defined (__HAIKU__)
 #define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2"
 #define DEFAULTWADLOCATION2 "/usr/local/games/SRB2"
 #define DEFAULTWADLOCATION3 "/usr/share/games/SRB2"
 #define DEFAULTWADLOCATION4 "/usr/games/SRB2"
+#define DEFAULTWADLOCATION5 "/boot/system/data/srb2"
 #define DEFAULTSEARCHPATH1 "/usr/local/games"
 #define DEFAULTSEARCHPATH2 "/usr/games"
 #define DEFAULTSEARCHPATH3 "/usr/local"
+#define DEFAULTSEARCHPATH4 "/boot/system/data"
 #elif defined (_WIN32)
 #define DEFAULTWADLOCATION1 "c:\\games\\srb2"
 #define DEFAULTWADLOCATION2 "\\games\\srb2"
-- 
GitLab