Blender  V3.3
BLI_alloca.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
11 /* BLI_array_alloca / alloca */
12 
13 #include <stdlib.h>
14 
15 #if defined(__GNUC__) || defined(__clang__)
16 # if defined(__cplusplus) && (__cplusplus > 199711L)
17 # define BLI_array_alloca(arr, realsize) (decltype(arr))alloca(sizeof(*arr) * (realsize))
18 # else
19 # define BLI_array_alloca(arr, realsize) (typeof(arr))alloca(sizeof(*arr) * (realsize))
20 # endif
21 #else
22 # define BLI_array_alloca(arr, realsize) alloca(sizeof(*arr) * (realsize))
23 #endif