]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_sdl.c
bsp: Merge Q1/Q2 LoadSubmodels into one func. The differences were negligible
[xonotic/darkplaces.git] / sys_sdl.c
index 9a91c15536cd306582fb511081e0f44697fa3d19..9285f55dadf29ba177c00ddec7beb718438f2ad2 100644 (file)
--- a/sys_sdl.c
+++ b/sys_sdl.c
 
 #ifdef __ANDROID__
 #include <android/log.h>
-
-#ifndef FNDELAY
-#define FNDELAY                O_NDELAY
-#endif
 #endif
 
 #include <signal.h>
@@ -41,7 +37,7 @@ void Sys_Shutdown (void)
        Sys_AllowProfiling(false);
 #endif
 #ifndef WIN32
-       fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
+       fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
 #endif
        fflush(stdout);
        SDL_Quit();
@@ -55,14 +51,14 @@ void Sys_Error (const char *error, ...)
 
 // change stdin to non blocking
 #ifndef WIN32
-       fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
+       fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
 #endif
 
        va_start (argptr,error);
        dpvsnprintf (string, sizeof (string), error, argptr);
        va_end (argptr);
 
-       Con_Errorf ("Engine Error: %s\n", string);
+       Con_Printf(CON_ERROR "Engine Error: %s\n", string);
        
        if(!nocrashdialog)
                SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Engine Error", string, NULL);
@@ -81,12 +77,12 @@ void Sys_PrintToTerminal(const char *text)
 #else
        if(sys.outfd < 0)
                return;
-#ifdef FNDELAY
+#ifdef O_NDELAY
        // BUG: for some reason, NDELAY also affects stdout (1) when used on stdin (0).
        // this is because both go to /dev/tty by default!
        {
                int origflags = fcntl (sys.outfd, F_GETFL, 0);
-               fcntl (sys.outfd, F_SETFL, origflags & ~FNDELAY);
+               fcntl (sys.outfd, F_SETFL, origflags & ~O_NDELAY);
 #endif
 #ifdef WIN32
 #define write _write
@@ -98,7 +94,7 @@ void Sys_PrintToTerminal(const char *text)
                                break; // sorry, I cannot do anything about this error - without an output
                        text += written;
                }
-#ifdef FNDELAY
+#ifdef O_NDELAY
                fcntl (sys.outfd, F_SETFL, origflags);
        }
 #endif
@@ -218,7 +214,7 @@ int main (int argc, char *argv[])
                sys.outfd = 1;
 
 #ifndef WIN32
-       fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
+       fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);
 #endif
 
        // we don't know which systems we'll want to init, yet...