]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/stream/textstream.h
Centralise compile checks
[xonotic/netradiant.git] / libs / stream / textstream.h
index 7f8be898c12bc503e8173cfe95ba4eeffd03ea8e..25f3d1ad42d90b12db37b2cb395f8011da5e1aa0 100644 (file)
@@ -22,6 +22,8 @@
 #if !defined( INCLUDED_STREAM_TEXTSTREAM_H )
 #define INCLUDED_STREAM_TEXTSTREAM_H
 
+#include "globaldefs.h"
+
 /// \file
 /// \brief Text-output-formatting.
 
@@ -48,7 +50,7 @@ inline char* write_unsigned_nonzero_decimal_backward( char* ptr, unsigned int de
        return ptr;
 }
 
-  #if defined ( _WIN64 ) || defined ( __LP64__ )
+  #if GDEF_ARCH_BITS_64
 inline char* write_size_t_nonzero_decimal_backward( char* ptr, size_t decimal ){
        for (; decimal != 0; decimal /= 10 )
        {
@@ -78,7 +80,7 @@ inline char* write_unsigned_nonzero_decimal_backward( char* ptr, unsigned int de
        return ptr;
 }
 
-  #if defined ( _WIN64 ) || defined ( __LP64__ )
+  #if GDEF_ARCH_BITS_64
 inline char* write_size_t_nonzero_decimal_backward( char* ptr, size_t decimal, bool show_positive ){
        ptr = write_size_t_nonzero_decimal_backward( ptr, decimal );
        if ( show_positive ) {
@@ -110,7 +112,7 @@ inline char* write_unsigned_decimal_backward( char* ptr, unsigned int decimal, b
        return ptr;
 }
 
-  #if defined ( _WIN64 ) || defined ( __LP64__ )
+  #if GDEF_ARCH_BITS_64
 inline char* write_size_t_decimal_backward( char* ptr, size_t decimal, bool show_positive ){
        if ( decimal == 0 ) {
                *--ptr = '0';
@@ -125,7 +127,7 @@ inline char* write_size_t_decimal_backward( char* ptr, size_t decimal, bool show
 }
 
 
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
 #define snprintf _snprintf
 #endif
 
@@ -186,7 +188,7 @@ inline TextOutputStreamType& ostream_write( TextOutputStreamType& ostream, const
        return ostream;
 }
 
-#if defined ( _WIN64 ) || defined ( __LP64__ )
+#if GDEF_ARCH_BITS_64
 
 /// \brief Writes a size_t \p i to \p ostream in decimal form.
 template<typename TextOutputStreamType>