mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-29 07:41:47 +00:00
Merge pull request #581 from devnexen/haiku_port
Haiku porting proposal.
This commit is contained in:
commit
7439bdd45c
5 changed files with 33 additions and 1 deletions
|
@ -140,7 +140,11 @@ endif()
|
|||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
list(APPEND yquake2LinkerFlags "-lm -static-libgcc")
|
||||
else()
|
||||
list(APPEND yquake2LinkerFlags "-lm -rdynamic")
|
||||
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
||||
list(APPEND yquake2LinkerFlags "-lm -rdynamic")
|
||||
else()
|
||||
list(APPEND yquake2LinkerFlags "-lm -lnetwork")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(APPEND yquake2LinkerFlags ${CMAKE_DL_LIBS})
|
||||
|
|
2
Makefile
2
Makefile
|
@ -277,6 +277,8 @@ else ifeq ($(YQ2_OSTYPE),Windows)
|
|||
override LDFLAGS += -lws2_32 -lwinmm -static-libgcc
|
||||
else ifeq ($(YQ2_OSTYPE), Darwin)
|
||||
override LDFLAGS += -arch $(YQ2_ARCH)
|
||||
else ifeq ($(YQ2_OSTYPE), Haiku)
|
||||
override LDFLAGS += -lm -lnetwork
|
||||
endif
|
||||
|
||||
# Keep symbols hidden.
|
||||
|
|
|
@ -45,6 +45,10 @@
|
|||
#include <mach-o/dyld.h> // _NSGetExecutablePath
|
||||
#endif
|
||||
|
||||
#ifdef __HAIKU__
|
||||
#include <kernel/image.h>
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
// this is mostly for windows. windows has a MAX_PATH = 260 #define, but allows
|
||||
// longer paths anyway.. this might not be the maximum allowed length, but is
|
||||
|
@ -118,6 +122,22 @@ static void SetExecutablePath(char* exePath)
|
|||
|
||||
// TODO: realpath() ?
|
||||
// TODO: no idea what this is if the executable is in an app bundle
|
||||
#elif defined(__HAIKU__)
|
||||
image_info ii;
|
||||
int32_t id = 0;
|
||||
|
||||
exePath[0] = '\0';
|
||||
|
||||
for (; get_next_image_info(0, &id, &ii) == B_OK;)
|
||||
{
|
||||
if (ii.type == B_APP_IMAGE)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ii.type == B_APP_IMAGE)
|
||||
{
|
||||
Q_strlcpy(exePath, ii.name, PATH_MAX);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
#include <libgen.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#ifndef FNDELAY
|
||||
#define FNDELAY O_NDELAY
|
||||
#endif
|
||||
|
||||
#include "../../common/header/common.h"
|
||||
|
||||
|
|
|
@ -35,6 +35,9 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/select.h> /* for fd_set */
|
||||
#ifndef FNDELAY
|
||||
#define FNDELAY O_NDELAY
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <mach/clock.h>
|
||||
|
|
Loading…
Reference in a new issue