1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2024-12-23 01:59:43 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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