engine: Haiku OS support (#478)

This commit is contained in:
exstrim401 2021-06-05 12:54:37 +05:00 committed by GitHub
parent 947a615707
commit b7922368bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View File

@ -93,6 +93,8 @@ const char *Q_buildos( void )
osname = "emscripten";
#elif XASH_DOS4GW
osname = "DOS4GW";
#elif XASH_HAIKU
osname = "haiku";
#else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif

View File

@ -62,6 +62,10 @@ def configure(conf):
conf.fatal('SDL2 not availiable! If you want to build dedicated server, specify --dedicated')
conf.define('XASH_SDL', 2)
if conf.env.DEST_OS == 'haiku':
conf.env.LIB_HAIKU = ['network']
conf.env.LIBPATH_HAIKU = ['/boot/system/lib']
if conf.options.USE_SELECT == None:
conf.options.USE_SELECT = conf.options.DEDICATED
@ -112,6 +116,8 @@ def build(bld):
source += bld.path.ant_glob(['platform/dos/*.c'])
source += bld.path.ant_glob(['platform/stub/s_stub.c'])
if bld.env.DEST_OS == 'haiku':
libs.append('HAIKU')
if bld.get_define('XASH_CUSTOM_SWAP'):
source += bld.path.ant_glob(['platform/misc/kmalloc.c', 'platform/misc/sbrk.c'])

View File

@ -20,7 +20,7 @@ GNU General Public License for more details.
#include <stdlib.h>
#include <stdarg.h>
#if defined(__APPLE__) || defined(__unix__)
#if defined(__APPLE__) || defined(__unix__) || defined(__HAIKU__)
#define XASHLIB "libxash." OS_LIB_EXT
#elif _WIN32
#if !__MINGW32__ && _MSC_VER >= 1200

View File

@ -67,6 +67,7 @@ For more information, please refer to <http://unlicense.org/>
#undef XASH_MSVC
#undef XASH_NETBSD
#undef XASH_OPENBSD
#undef XASH_HAIKU
#undef XASH_WIN32
#undef XASH_WIN64
#undef XASH_X86
@ -115,6 +116,9 @@ For more information, please refer to <http://unlicense.org/>
#elif defined __WATCOMC__ && defined __DOS__
#define XASH_DOS4GW 1
#define XASH_LITTLE_ENDIAN
#elif defined __HAIKU__
#define XASH_HAIKU 1
#define XASH_POSIX 1
#else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif