Fix compilation on Haiku OS (#183)
* add haiku defines in q_platform.h and sys_sdl.c * linuxisms in sys_sdl.c and sv_sys_unix.c * more linuxisms in sv_sys_unix.c
This commit is contained in:
parent
7e39cdd689
commit
8482809f18
3 changed files with 13 additions and 11 deletions
|
@ -11,7 +11,7 @@
|
|||
#ifndef WIN32
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)) //apple make everything painful.
|
||||
#if defined(__unix__) || defined(__unix) ||defined(__HAIKU__) || (defined(__APPLE__) && defined(__MACH__)) //apple make everything painful.
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#else
|
||||
|
@ -646,7 +646,7 @@ int Sys_EnumerateFiles (const char *gpath, const char *match, int (QDECL *func)(
|
|||
strcat(fullmatch, match);
|
||||
return Sys_EnumerateFiles2(fullmatch, start, start, func, parm, spath);
|
||||
}
|
||||
#elif defined(linux) || defined(__unix__) || defined(__MACH__)
|
||||
#elif defined(linux) || defined(__unix__) || defined(__MACH__) || defined(__HAIKU__)
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
static int Sys_EnumerateFiles2 (const char *truepath, int apathofs, const char *match, int (*func)(const char *, qofs_t, time_t modtime, void *, searchpathfuncs_t *), void *parm, searchpathfuncs_t *spath)
|
||||
|
@ -961,8 +961,8 @@ int QDECL main(int argc, char **argv)
|
|||
parms.manifest = CONFIG_MANIFEST_TEXT;
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
|
||||
#if !defined(WIN32)
|
||||
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);
|
||||
#endif
|
||||
|
||||
COM_InitArgv (parms.argc, parms.argv);
|
||||
|
|
|
@ -291,7 +291,7 @@ void Sys_Error (const char *error, ...)
|
|||
if (!noconinput)
|
||||
{
|
||||
tcsetattr(STDIN_FILENO, TCSADRAIN, &orig);
|
||||
fcntl (STDIN_FILENO, F_SETFL, fcntl (STDIN_FILENO, F_GETFL, 0) & ~FNDELAY);
|
||||
fcntl (STDIN_FILENO, F_SETFL, fcntl (STDIN_FILENO, F_GETFL, 0) & ~O_NDELAY);
|
||||
}
|
||||
|
||||
//we used to fire sigsegv. this resulted in people reporting segfaults and not the error message that appeared above. resulting in wasted debugging.
|
||||
|
@ -593,7 +593,7 @@ void Sys_Quit (void)
|
|||
if (!noconinput)
|
||||
{
|
||||
tcsetattr(STDIN_FILENO, TCSADRAIN, &orig);
|
||||
fcntl (STDIN_FILENO, F_SETFL, fcntl (STDIN_FILENO, F_GETFL, 0) & ~FNDELAY);
|
||||
fcntl (STDIN_FILENO, F_SETFL, fcntl (STDIN_FILENO, F_GETFL, 0) & ~O_NDELAY);
|
||||
}
|
||||
exit (0); // appkit isn't running
|
||||
}
|
||||
|
@ -700,9 +700,9 @@ char *Sys_ConsoleInput (void)
|
|||
#if defined(__linux__)
|
||||
{
|
||||
int fl = fcntl (STDIN_FILENO, F_GETFL, 0);
|
||||
if (!(fl & FNDELAY))
|
||||
if (!(fl & O_NDELAY))
|
||||
{
|
||||
fcntl(STDIN_FILENO, F_SETFL, fl | FNDELAY);
|
||||
fcntl(STDIN_FILENO, F_SETFL, fl | O_NDELAY);
|
||||
// Sys_Printf(CON_WARNING "stdin flags became blocking - gdb bug?\n");
|
||||
}
|
||||
}
|
||||
|
@ -996,8 +996,8 @@ static int Sys_CheckChRoot(void)
|
|||
static void SigCont(int code)
|
||||
{ //lets us know when we regained foreground focus.
|
||||
int fl = fcntl (STDIN_FILENO, F_GETFL, 0);
|
||||
if (!(fl & FNDELAY))
|
||||
fcntl(STDIN_FILENO, F_SETFL, fl | FNDELAY);
|
||||
if (!(fl & O_NDELAY))
|
||||
fcntl(STDIN_FILENO, F_SETFL, fl | O_NDELAY);
|
||||
noconinput &= ~2;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -163,7 +163,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
||||
//================================================================= LINUX ===
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(ANDROID) || defined(__ANDROID__)
|
||||
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(ANDROID) || defined(__ANDROID__) || defined(__HAIKU__)
|
||||
|
||||
#include <endian.h>
|
||||
|
||||
|
@ -171,6 +171,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#define OS_STRING "android"
|
||||
#elif defined(__linux__)
|
||||
#define OS_STRING "linux"
|
||||
#elif defined(__HAIKU__)
|
||||
#define OS_STRING "Haiku"
|
||||
#else
|
||||
#define OS_STRING "kFreeBSD"
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue