]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.h
Changes necessary to build and run on Solaris 10 x86
[xonotic/darkplaces.git] / common.h
index 4cc520e34c12a571da720379bfdb463bed51a46c..599495c68848bc6572694f6ce7e6fbb0a7f38494 100644 (file)
--- a/common.h
+++ b/common.h
@@ -33,6 +33,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 # define MACOSX
 #endif
 
+// Create our own define for Solaris
+#if defined(__sun__) && defined(__svr4__)
+# define SUNOS
+#endif
+
+#ifdef SUNOS
+# define FNDELAY O_NDELAY      // FNDELAY's equivalent on SunOS is O_NDELAY
+# define model_t dp_model_t // Workaround conflict with /usr/include/sys/model.h
+#endif
 
 //============================================================================
 
@@ -76,8 +85,16 @@ unsigned short CRC_Block(const qbyte *data, int size);
 # if defined(WIN32)
 #  define BYTE_ORDER LITTLE_ENDIAN
 # else
-#  warning "Unable to determine the CPU endianess. Defaulting to little endian"
-#  define BYTE_ORDER LITTLE_ENDIAN
+#  if defined(SUNOS)
+#   if defined(__i386) || defined(__amd64)
+#    define BYTE_ORDER LITTLE_ENDIAN
+#   else
+#    define BYTE_ORDER BIG_ENDIAN
+#   endif
+#  else
+#   warning "Unable to determine the CPU endianess. Defaulting to little endian"
+#   define BYTE_ORDER LITTLE_ENDIAN
+#  endif
 # endif
 #endif