diff options
author | Chris Robinson <[email protected]> | 2014-03-25 18:16:03 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-03-25 18:16:03 -0700 |
commit | 045959e9c00979128679ca77b10b929182fe3397 (patch) | |
tree | cba018b5a2aecfae723e372694a0281fdf936614 /OpenAL32/Include/alMain.h | |
parent | 03fd2b826658bae6bd975957c4af26ae42481756 (diff) |
Use C99 VLA instead of alloca when available
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r-- | OpenAL32/Include/alMain.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 04514b5e..3d1f062a 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -314,6 +314,12 @@ typedef ptrdiff_t ALsizeiptrEXT; #define FORCE_ALIGN #endif +#ifdef HAVE_C99_VLA +#define DECL_VLA(T, _name, _size) T _name[(_size)] +#else +#define DECL_VLA(T, _name, _size) T *_name = alloca((_size) * sizeof(T)) +#endif + #ifndef PATH_MAX #ifdef MAX_PATH #define PATH_MAX MAX_PATH |