]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_unix.c
Missed one
[xonotic/darkplaces.git] / sys_unix.c
index 4837d3ad82353a1ef08838f8dd1b1a355cc715d8..031c55d8d9353dbb0f153928e5d100256efe6b4a 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <signal.h>
 
-#include "quakedef.h"
+#include "darkplaces.h"
 
 sys_t sys;
 
@@ -22,7 +22,7 @@ sys_t sys;
 void Sys_Shutdown (void)
 {
 #ifndef WIN32
-       fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
+       fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
 #endif
        fflush(stdout);
 }
@@ -34,7 +34,7 @@ void Sys_Error (const char *error, ...)
 
 // change stdin to non blocking
 #ifndef WIN32
-       fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
+       fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NONBLOCK);
 #endif
        va_start (argptr,error);
        dpvsnprintf (string, sizeof (string), error, argptr);
@@ -55,7 +55,7 @@ void Sys_PrintToTerminal(const char *text)
        {
 #ifndef WIN32
                int origflags = fcntl (sys.outfd, F_GETFL, 0);
-               fcntl (sys.outfd, F_SETFL, origflags & ~O_NDELAY);
+               fcntl (sys.outfd, F_SETFL, origflags & ~O_NONBLOCK);
 #else
 #define write _write
 #endif
@@ -154,16 +154,20 @@ int main (int argc, char **argv)
        Sys_ProvideSelfFD();
 
        // COMMANDLINEOPTION: sdl: -noterminal disables console output on stdout
-       if(COM_CheckParm("-noterminal"))
+       if(Sys_CheckParm("-noterminal"))
                sys.outfd = -1;
        // COMMANDLINEOPTION: sdl: -stderr moves console output to stderr
-       else if(COM_CheckParm("-stderr"))
+       else if(Sys_CheckParm("-stderr"))
                sys.outfd = 2;
        else
                sys.outfd = 1;
 #ifndef WIN32
-       fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);
+       fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NONBLOCK);
 #endif
+
+       // used by everything
+       Memory_Init();
+
        Host_Main();
 
        Sys_Quit(0);
@@ -171,7 +175,7 @@ int main (int argc, char **argv)
        return 0;
 }
 
-qboolean sys_supportsdlgetticks = false;
+qbool sys_supportsdlgetticks = false;
 unsigned int Sys_SDL_GetTicks (void)
 {
        Sys_Error("Called Sys_SDL_GetTicks on non-SDL target");