Blender  V3.3
BLI_compiler_compat.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /* clang-format off */
4 
5 /* #define typeof() triggers a bug in some clang-format versions, disable format
6  * for entire file to keep results consistent. */
7 
8 #pragma once
9 
10 
17 #if defined(_MSC_VER)
18 # define alloca _alloca
19 #endif
20 
21 #if (defined(__GNUC__) || defined(__clang__)) && defined(__cplusplus)
22 extern "C++" {
24 template<typename T> static inline T decltype_helper(T x)
25 {
26  return x;
27 }
28 #define typeof(x) decltype(decltype_helper(x))
29 }
30 #endif
31 
32 /* little macro so inline keyword works */
33 #if defined(_MSC_VER)
34 # define BLI_INLINE static __forceinline
35 #else
36 # define BLI_INLINE static inline __attribute__((always_inline)) __attribute__((__unused__))
37 #endif
38 
39 #if defined(__GNUC__)
40 # define BLI_NOINLINE __attribute__((noinline))
41 #else
42 # define BLI_NOINLINE
43 #endif
#define T