]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/splines/q_shared.h
[q3map2] Unwind script stack in case of script loading error.
[xonotic/netradiant.git] / libs / splines / q_shared.h
index 61f1024be1c2bd8e3509e922b383233cf2c37bd1..10a75625cb8cc8405c1d34324b60d98ca4e565f0 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef __Q_SHARED_H
 #define __Q_SHARED_H
 
+#include "globaldefs.h"
+
 // q_shared.h -- included first by ALL program modules.
 // these are the definitions that have no dependance on
 // central system services, and can be used by any part
@@ -35,7 +37,7 @@
 #define ALIGN_ON
 #define ALIGN_OFF
 
-#ifdef _WIN32
+#if GDEF_COMPILER_MSVC
 
 #pragma warning(disable : 4018)     // signed/unsigned mismatch
 #pragma warning(disable : 4032)
 #include <stdlib.h>
 #include <time.h>
 #include <ctype.h>
-#ifdef WIN32                // mac doesn't have malloc.h
+#include <cstddef>
+
+#if GDEF_OS_WINDOWS                // mac doesn't have malloc.h
 #include <malloc.h>         // for _alloca()
 #endif
-#ifdef _WIN32
+#if GDEF_COMPILER_MSVC
 
 //#pragma intrinsic( memset, memcpy )
 
@@ -76,7 +80,7 @@
 
 
 // this is the define for determining if we have an asm version of a C function
-#if ( defined _M_IX86 || defined __i386__ ) && !defined __sun__  && !defined __LCC__
+#if GDEF_ARCH_BITS_32 && !defined __sun__  && !defined __LCC__
 #define id386   1
 #else
 #define id386   0
@@ -88,7 +92,7 @@
 
 //======================= WIN32 DEFINES =================================
 
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
 
 #define MAC_STATIC
 
 
 // buildstring will be incorporated into the version string
 #ifdef NDEBUG
-#ifdef _M_IX86
+#if GDEF_ARCH_BITS_32
 #define CPUSTRING   "win-x86"
 #elif defined _M_ALPHA
 #define CPUSTRING   "win-AXP"
 #endif
 #else
-#ifdef _M_IX86
+#if GDEF_ARCH_BITS_32
 #define CPUSTRING   "win-x86-debug"
 #elif defined _M_ALPHA
 #define CPUSTRING   "win-AXP-debug"
 
 //======================= MAC OS X SERVER DEFINES =====================
 
-#if defined( __MACH__ ) && defined( __APPLE__ )
+#if GDEF_OS_MACOS && defined( __MACH__ )
 
 #define MAC_STATIC
 
 #ifdef __ppc__
 #define CPUSTRING   "MacOSXS-ppc"
-#elif defined __i386__
+#elif GDEF_ARCH_BITS_32
 #define CPUSTRING   "MacOSXS-i386"
 #else
 #define CPUSTRING   "MacOSXS-other"
 
 #undef ALIGN_ON
 #undef ALIGN_OFF
-#define ALIGN_ON        # pragma align( 16 )
-#define ALIGN_OFF       # pragma align()
+#define ALIGN_ON        #pragma align( 16 )
+#define ALIGN_OFF       #pragma align()
 
 #ifdef __cplusplus
 extern "C" {
@@ -188,11 +192,11 @@ void Sys_PumpEvents( void );
 
 // the mac compiler can't handle >32k of locals, so we
 // just waste space and make big arrays static...
-#ifdef __linux__
+#if GDEF_OS_LINUX
 
 #define MAC_STATIC
 
-#ifdef __i386__
+#if GDEF_ARCH_BITS_32
 #define CPUSTRING   "linux-i386"
 #elif defined __axp__
 #define CPUSTRING   "linux-alpha"
@@ -591,7 +595,7 @@ void Com_Parse3DMatrix( const char *( *buf_p ), int z, int y, int x, float *m );
 extern "C" {
 #endif
 
-void QDECL Com_sprintf( char *dest, int size, const char *fmt, ... );
+void QDECL Com_sprintf( char *dest, std::size_t size, const char *fmt, ... );
 
 
 // mode parm for FS_FOpenFile
@@ -624,8 +628,8 @@ char    *Q_strupr( char *s1 );
 char    *Q_strrchr( const char* string, int c );
 
 // buffer size safe library replacements
-void    Q_strncpyz( char *dest, const char *src, int destsize );
-void    Q_strcat( char *dest, int size, const char *src );
+void    Q_strncpyz( char *dest, const char *src, std::size_t destsize );
+void    Q_strcat( char *dest, std::size_t size, const char *src );
 
 // strlen that discounts Quake color sequences
 int Q_PrintStrlen( const char *string );