Blender  V2.93
BLI_math_inline.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  *
19  * The Original Code is: some of this file.
20  */
21 
22 #pragma once
23 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /* add platform/compiler checks here if it is not supported */
33 /* all platforms support forcing inline so this is always enabled */
34 #define BLI_MATH_DO_INLINE 1
35 
36 #if BLI_MATH_DO_INLINE
37 # ifdef _MSC_VER
38 # define MINLINE static __forceinline
39 # define MALWAYS_INLINE MINLINE
40 # else
41 # define MINLINE static inline
42 # define MALWAYS_INLINE static inline __attribute__((always_inline)) __attribute__((unused))
43 # endif
44 #else
45 # define MINLINE
46 # define MALWAYS_INLINE
47 #endif
48 
49 /* gcc 4.6 (supports push/pop) */
50 #if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406))
51 # define BLI_MATH_GCC_WARN_PRAGMA 1
52 #endif
53 
54 #ifdef __cplusplus
55 }
56 #endif