mirror of
https://github.com/ValveSoftware/GameNetworkingSockets.git
synced 2026-05-29 16:20:34 +00:00
Clean out minbase.h. Improve Xbox and Switch compat.
This commit is contained in:
@@ -69,45 +69,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// decls for aligning data
|
||||
#ifdef _WIN32
|
||||
#define DECL_ALIGN(x) __declspec(align(x))
|
||||
#elif defined(GNUC)
|
||||
#define DECL_ALIGN(x) __attribute__((aligned(x)))
|
||||
#elif defined ( COMPILER_GCC ) || defined( COMPILER_SNC )
|
||||
#define DECL_ALIGN(x) __attribute__( ( aligned( x ) ) )
|
||||
#else
|
||||
#define DECL_ALIGN(x) /* */
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// MSVC has the align at the start of the struct
|
||||
#define ALIGN8 DECL_ALIGN(8)
|
||||
#define ALIGN16 DECL_ALIGN(16)
|
||||
#define ALIGN32 DECL_ALIGN(32)
|
||||
#define ALIGN128 DECL_ALIGN(128)
|
||||
|
||||
#define ALIGN8_POST
|
||||
#define ALIGN16_POST
|
||||
#define ALIGN32_POST
|
||||
#define ALIGN128_POST
|
||||
#elif defined( GNUC ) || defined( COMPILER_PS3 )
|
||||
// gnuc has the align decoration at the end
|
||||
#define ALIGN4
|
||||
#define ALIGN8
|
||||
#define ALIGN16
|
||||
#define ALIGN32
|
||||
#define ALIGN128
|
||||
|
||||
#define ALIGN4_POST DECL_ALIGN(4)
|
||||
#define ALIGN8_POST DECL_ALIGN(8)
|
||||
#define ALIGN16_POST DECL_ALIGN(16)
|
||||
#define ALIGN32_POST DECL_ALIGN(32)
|
||||
#define ALIGN128_POST DECL_ALIGN(128)
|
||||
#else
|
||||
#error
|
||||
#endif
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
|
||||
#define NOALIAS __declspec(noalias)
|
||||
|
||||
@@ -118,89 +118,88 @@
|
||||
#define IsDebug() false
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define IsWindows() true
|
||||
#define IsPosix() false
|
||||
#define IsLinux() false
|
||||
#define IsOSX() false
|
||||
#define IsPS3() false
|
||||
#define IsX360() false
|
||||
#ifndef _XBOX
|
||||
#define IsPC() true
|
||||
#define IsConsole() false
|
||||
#define IsXbox() false
|
||||
#else
|
||||
#ifndef _CONSOLE
|
||||
#define _CONSOLE
|
||||
#endif
|
||||
#define IsPC() false
|
||||
#define IsConsole() true
|
||||
#define IsXbox() true
|
||||
#endif
|
||||
#define IsARM() false
|
||||
#define IsAndroid() false
|
||||
|
||||
#elif defined( _PS3 )
|
||||
#define IsWindows() false
|
||||
#define IsPC() false
|
||||
#define IsConsole() true
|
||||
#define IsXbox() false
|
||||
#define IsLinux() false
|
||||
#define IsPosix() true
|
||||
#define IsOSX() false
|
||||
#define IsPS3() true
|
||||
#define IsX360() false
|
||||
#define IsARM() false
|
||||
#define IsAndroid() false
|
||||
#if defined( _XBOX_ONE )
|
||||
#ifndef _CONSOLE
|
||||
#define _CONSOLE
|
||||
#endif
|
||||
|
||||
#elif defined( _X360 )
|
||||
#define IsWindows() false
|
||||
#define IsPC() false
|
||||
#define IsConsole() true
|
||||
#define IsXbox() false
|
||||
#define IsLinux() false
|
||||
#define IsPosix() false
|
||||
#define IsOSX() false
|
||||
#define IsPS3() false
|
||||
#define IsX360() true
|
||||
#define IsARM() false
|
||||
#define IsAndroid() false
|
||||
|
||||
#elif defined(POSIX)
|
||||
#define IsWindows() false
|
||||
#define IsXboxOne() true
|
||||
#elif defined( NN_NINTENDO_SDK )
|
||||
#ifndef _CONSOLE
|
||||
#define _CONSOLE
|
||||
#endif
|
||||
#ifndef POSIX
|
||||
#define POSIX
|
||||
#endif
|
||||
#define IsNintendoSwitch() true
|
||||
#elif defined( _WIN32 )
|
||||
#define IsWindows() true
|
||||
#define IsPC() true
|
||||
#define IsConsole() false
|
||||
#define IsXbox() false
|
||||
#elif defined( _PS3 )
|
||||
#define IsConsole() true
|
||||
#define IsPosix() true
|
||||
#if defined(LINUX)
|
||||
#define IsLinux() true
|
||||
#define IsPS3() true
|
||||
#elif defined(POSIX)
|
||||
#define IsPC() true
|
||||
#define IsPosix() true
|
||||
#ifdef LINUX
|
||||
#define IsLinux() true
|
||||
#endif
|
||||
#ifdef OSX
|
||||
#define SUPPORTS_IOPOLLINGHELPER
|
||||
#define IsOSX() true
|
||||
#endif
|
||||
#else
|
||||
#define IsLinux() false
|
||||
#endif
|
||||
#if defined(OSX)
|
||||
#define SUPPORTS_IOPOLLINGHELPER
|
||||
#define IsOSX() true
|
||||
#else
|
||||
#define IsOSX() false
|
||||
#endif
|
||||
#define IsPS3() false
|
||||
#define IsX360() false
|
||||
#if defined(__arm__)
|
||||
#define IsARM() true
|
||||
#else
|
||||
#define IsARM() false
|
||||
#endif
|
||||
#if defined(ANDROID)
|
||||
#define IsAndroid() true
|
||||
#else
|
||||
#define IsAndroid() false
|
||||
#error Undefined platform
|
||||
#endif
|
||||
|
||||
#else
|
||||
#error Undefined platform
|
||||
#ifndef IsWindows
|
||||
#define IsWindows() false
|
||||
#endif
|
||||
#ifndef IsPC
|
||||
#define IsPC() false
|
||||
#endif
|
||||
#ifndef IsConsole
|
||||
#ifdef _CONSOLE
|
||||
#define IsConsole() true
|
||||
#else
|
||||
#define IsConsole() false
|
||||
#endif
|
||||
#endif
|
||||
#ifndef IsNintendoSwitch
|
||||
#define IsNintendoSwitch() false
|
||||
#endif
|
||||
#ifndef IsXboxOne
|
||||
#define IsXboxOne() false
|
||||
#endif
|
||||
#ifndef IsLinux
|
||||
#define IsLinux() false
|
||||
#endif
|
||||
#ifndef IsPosix
|
||||
#define IsPosix() false
|
||||
#endif
|
||||
#ifndef IsOSX
|
||||
#define IsOSX() false
|
||||
#endif
|
||||
#ifndef IsPS3
|
||||
#define IsPS3() false
|
||||
#endif
|
||||
#ifndef IsX360
|
||||
#define IsX360() false
|
||||
#endif
|
||||
#ifndef IsARM
|
||||
#ifdef __arm__
|
||||
#define IsARM() true
|
||||
#else
|
||||
#define IsARM() false
|
||||
#endif
|
||||
#endif
|
||||
#ifndef IsAndroid
|
||||
#ifdef ANDROID
|
||||
#define IsAndroid() true
|
||||
#else
|
||||
#define IsAndroid() false
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif // #ifndef MINBASE_IDENTIFY_H
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
// If available use static_assert instead of weird language tricks. This
|
||||
// leads to much more readable messages when compile time assert constraints
|
||||
// are violated.
|
||||
#if !defined(OSX) && (_MSC_VER > 1500 || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
|
||||
#if !defined(OSX) && (_MSC_VER > 1500 || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || defined(__clang__) )
|
||||
#define PLAT_COMPILE_TIME_ASSERT( pred ) static_assert( pred, "Compile time assert constraint is not true: " #pred )
|
||||
#else
|
||||
#define PLAT_COMPILE_TIME_ASSERT( pred ) typedef int UNIQUE_ID[ (pred) ? 1 : -1]
|
||||
|
||||
Reference in New Issue
Block a user