]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fix OpenSolaris build. Add platform ID for a few other platforms
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 22 Jul 2020 13:58:22 +0000 (13:58 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 22 Jul 2020 13:58:22 +0000 (13:58 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12862 d7cf8633-e32d-0410-b094-e92efae38249

common.h
quakedef.h
sys_sdl.c
sys_unix.c

index bf1d5c134e68ddaa660a6979fced421d274ac244..f05450f9666c79649a3d2cb39c8f15a63c688534 100644 (file)
--- a/common.h
+++ b/common.h
@@ -35,9 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 # define MACOSX
 #endif
 
-#ifdef SUNOS
-#include <sys/file.h>          ///< Needed for O_NDELAY
-#endif
 
 //============================================================================
 
index 1596f94e5dae8c1291d98c8b6435ee043f44297f..207c05f6c7eaab0e8dadd6eba45d369e3f5e8e97 100644 (file)
@@ -460,12 +460,23 @@ extern cvar_t sessionid;
 #elif defined(__OpenBSD__)
 # define DP_OS_NAME            "OpenBSD"
 # define DP_OS_STR             "openbsd"
+#elif defined(__DragonFly__)
+# define DP_OS_NAME            "DragonFlyBSD"
+# define DP_OS_STR             "dragonflybsd"
 #elif defined(MACOSX)
 # define DP_OS_NAME            "Mac OS X"
 # define DP_OS_STR             "osx"
 #elif defined(__MORPHOS__)
 # define DP_OS_NAME            "MorphOS"
 # define DP_OS_STR             "morphos"
+#elif defined (sun) || defined (__sun)
+# if defined (__SVR4) || defined (__svr4__)
+#  define DP_OS_NAME   "Solaris"
+#  define DP_OS_STR            "solaris"
+# else
+#  define DP_OS_NAME   "SunOS"
+#  define DP_OS_STR            "sunos"
+# endif
 #else
 # define DP_OS_NAME            "Unknown"
 # define DP_OS_STR             "unknown"
index e57bd669cfce35a14dd0b82396061521e1b5586b..8667f7222333d81848d6497458d12ab27f097827 100644 (file)
--- a/sys_sdl.c
+++ b/sys_sdl.c
@@ -37,7 +37,7 @@ void Sys_Shutdown (void)
        Sys_AllowProfiling(false);
 #endif
 #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);
        SDL_Quit();
@@ -51,7 +51,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);
@@ -77,12 +77,12 @@ void Sys_PrintToTerminal(const char *text)
 #else
        if(sys.outfd < 0)
                return;
-#ifdef O_NDELAY
+#ifndef WIN32
        // 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 & ~O_NDELAY);
+               fcntl (sys.outfd, F_SETFL, origflags & ~O_NONBLOCK);
 #endif
 #ifdef WIN32
 #define write _write
@@ -94,7 +94,7 @@ void Sys_PrintToTerminal(const char *text)
                                break; // sorry, I cannot do anything about this error - without an output
                        text += written;
                }
-#ifdef O_NDELAY
+#ifndef WIN32
                fcntl (sys.outfd, F_SETFL, origflags);
        }
 #endif
@@ -214,7 +214,7 @@ int main (int argc, char *argv[])
                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
 
        // we don't know which systems we'll want to init, yet...
index 4837d3ad82353a1ef08838f8dd1b1a355cc715d8..70e4bd560078da876e16a345aac72a3b54c87be9 100644 (file)
@@ -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
@@ -162,7 +162,7 @@ int main (int argc, char **argv)
        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
        Host_Main();