aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/tier0/platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'mp/src/public/tier0/platform.h')
-rw-r--r--mp/src/public/tier0/platform.h61
1 files changed, 50 insertions, 11 deletions
diff --git a/mp/src/public/tier0/platform.h b/mp/src/public/tier0/platform.h
index 389ab5b8..652c27c0 100644
--- a/mp/src/public/tier0/platform.h
+++ b/mp/src/public/tier0/platform.h
@@ -9,6 +9,18 @@
#ifndef PLATFORM_H
#define PLATFORM_H
+#if defined(__x86_64__) || defined(_WIN64)
+#define PLATFORM_64BITS 1
+#endif
+
+#if defined(__GCC__) || defined(__GNUC__)
+#define COMPILER_GCC 1
+#endif
+
+#ifdef __clang__
+#define COMPILER_CLANG 1
+#endif
+
#if defined( _X360 )
#define NO_STEAM
#define NO_VOICE
@@ -51,14 +63,13 @@
// need this for _alloca
#include <alloca.h>
#include <unistd.h>
- #include <signal.h>
+#include <signal.h>
#include <time.h>
#endif
#include <malloc.h>
#include <new>
-
// need this for memset
#include <string.h>
@@ -148,10 +159,6 @@
typedef unsigned char uint8;
typedef signed char int8;
-#if defined(__x86_64__) || defined(_WIN64)
- #define X64BITS
-#endif // __x86_64__
-
#if defined( _WIN32 )
typedef __int16 int16;
@@ -191,7 +198,7 @@ typedef signed char int8;
typedef unsigned int uint32;
typedef long long int64;
typedef unsigned long long uint64;
- #ifdef X64BITS
+ #ifdef PLATFORM_64BITS
typedef long long intp;
typedef unsigned long long uintp;
#else
@@ -202,17 +209,39 @@ typedef signed char int8;
// Avoid redefinition warnings if a previous header defines this.
#undef OVERRIDE
- #if defined(__clang__)
+ #if __cplusplus >= 201103L
#define OVERRIDE override
- // warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
- // Disabling this warning is less intrusive than enabling C++11 extensions
- #pragma GCC diagnostic ignored "-Wc++11-extensions"
+ #if defined(__clang__)
+ // warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
+ // Disabling this warning is less intrusive than enabling C++11 extensions
+ #pragma GCC diagnostic ignored "-Wc++11-extensions"
+ #endif
#else
#define OVERRIDE
#endif
#endif // else _WIN32
+//-----------------------------------------------------------------------------
+// Set up platform type defines.
+//-----------------------------------------------------------------------------
+#if defined( PLATFORM_X360 ) || defined( _PS3 )
+ #if !defined( _GAMECONSOLE )
+ #define _GAMECONSOLE
+ #endif
+ #define IsPC() false
+ #define IsGameConsole() true
+#else
+ #define IsPC() true
+ #define IsGameConsole() false
+#endif
+
+#ifdef PLATFORM_64BITS
+ #define IsPlatform64Bits() true
+#else
+ #define IsPlatform64Bits() false
+#endif
+
// From steam/steamtypes.h
// RTime32
// We use this 32 bit time representing real world time.
@@ -407,6 +436,13 @@ typedef void * HINSTANCE;
#define DebuggerBreakIfDebugging_StagingOnly()
#endif
+// Allows you to specify code that should only execute if we are in a staging build. Otherwise the code noops.
+#ifdef STAGING_ONLY
+#define STAGING_ONLY_EXEC( _exec ) do { _exec; } while (0)
+#else
+#define STAGING_ONLY_EXEC( _exec ) do { } while (0)
+#endif
+
// C functions for external declarations that call the appropriate C++ methods
#ifndef EXPORT
#ifdef _WIN32
@@ -1177,6 +1213,9 @@ struct CPUInformation
tchar* m_szProcessorID; // Processor vendor Identification.
+ uint32 m_nModel;
+ uint32 m_nFeatures[3];
+
CPUInformation(): m_Size(0){}
};