1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2026-10-10 11:53:05 +08:00

tf2: Fix duplicate stackalloc in tier0/platform.h (#119)

This commit is contained in:
Mikusch
2022-12-02 01:12:19 +01:00
committed by GitHub
parent 9c891b6443
commit 320e2adaff
+2 -9
View File
@@ -358,6 +358,8 @@ typedef void * HINSTANCE;
#define mallocsize( _p ) ( _msize( _p ) )
#endif
#define stackfree( _p ) 0
// Linux had a few areas where it didn't construct objects in the same order that Windows does.
// So when CVProfile::CVProfile() would access g_pMemAlloc, it would crash because the allocator wasn't initalized yet.
#if defined(_LINUX) || defined(__APPLE__)
@@ -459,15 +461,6 @@ typedef void * HINSTANCE;
// as little code as possible, and throw an assertion in debug.
#define NO_DEFAULT default: UNREACHABLE();
#ifdef _WIN32
// Alloca defined for this platform
#define stackalloc( _size ) _alloca( ALIGN_VALUE( _size, 16 ) )
#define stackfree( _p )
#elif defined(_LINUX) || defined(__APPLE__)
// Alloca defined for this platform
#define stackalloc( _size ) _alloca( ALIGN_VALUE( _size, 16 ) )
#define stackfree( _p )
#endif
#ifdef _WIN32
#define RESTRICT __restrict