]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/bytestreamutils.h
fixed camera freemove shortcuts bug
[xonotic/netradiant.git] / libs / bytestreamutils.h
index 1e39b964ca12790bc742b1ad86c4347add744e2c..c340d5443d0303595853f5bf12956a37085a9ff6 100644 (file)
@@ -22,16 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #if !defined(INCLUDED_BYTESTREAMUTILS_H)
 #define INCLUDED_BYTESTREAMUTILS_H
 
-#include <algorithm>
-
-#if defined(_MSC_VER)
-
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-
-#else
+#if defined(__GCC__)
 
 #define        _ISOC9X_SOURCE  1
 #define _ISOC99_SOURCE 1
@@ -43,6 +34,24 @@ typedef unsigned int uint32_t;
 
 #endif
 
+#include <algorithm>
+
+// if C99 is unavailable, fall back to the types most likely to be the right sizes
+#if !defined(int16_t)
+typedef signed short int16_t;
+#endif
+#if !defined(uint16_t)
+typedef unsigned short uint16_t;
+#endif
+#if !defined(int32_t)
+typedef signed int int32_t;
+#endif
+#if !defined(uint32_t)
+typedef unsigned int uint32_t;
+#endif
+
+
+
 
 template<typename InputStreamType, typename Type>
 inline void istream_read_little_endian(InputStreamType& istream, Type& value)