mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-22 02:31:03 +00:00
_alloca16(): Use __builtin_alloca_with_align() on GCC
we're already using it with MinGW, no reason not to use it with "normal" GCC on Unix (and clang, which also defines __GNUC__) as well.
This commit is contained in:
parent
56b3c46ba8
commit
6f35ce045d
1 changed files with 7 additions and 2 deletions
|
@ -185,8 +185,13 @@ If you have questions concerning this license or the applicable additional terms
|
|||
// Unix
|
||||
#ifdef __unix__
|
||||
|
||||
#define _alloca( x ) (({assert( (x)<ID_MAX_ALLOCA_SIZE );}), alloca( (x) ))
|
||||
#define _alloca16( x ) (({assert( (x)<ID_MAX_ALLOCA_SIZE );}),((void *)((((uintptr_t)alloca( (x)+15 )) + 15) & ~15)))
|
||||
#ifdef __GNUC__
|
||||
#define _alloca16( x ) ( ({assert((x)<ID_MAX_ALLOCA_SIZE);}), __builtin_alloca_with_align( (x), 16*8 ) )
|
||||
#define _alloca( x ) ( ({assert((x)<ID_MAX_ALLOCA_SIZE);}), __builtin_alloca( (x) ) )
|
||||
#else
|
||||
#define _alloca( x ) (({assert( (x)<ID_MAX_ALLOCA_SIZE );}), alloca( (x) ))
|
||||
#define _alloca16( x ) (({assert( (x)<ID_MAX_ALLOCA_SIZE );}),((void *)((((uintptr_t)alloca( (x)+15 )) + 15) & ~15)))
|
||||
#endif
|
||||
|
||||
#ifdef GAME_DLL
|
||||
#define ID_GAME_API __attribute__((visibility ("default")))
|
||||
|
|
Loading…
Reference in a new issue