2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: some of this file.
23 * ***** END GPL LICENSE BLOCK *****
26 #ifndef __BLI_MATH_INLINE_H__
27 #define __BLI_MATH_INLINE_H__
29 /** \file BLI_math_inline.h
37 /* add platform/compiler checks here if it is not supported */
38 /* all platforms support forcing inline so this is always enabled */
39 #define BLI_MATH_DO_INLINE 1
41 #if BLI_MATH_DO_INLINE
43 # define MINLINE static __forceinline
44 # define MALWAYS_INLINE MINLINE
46 # define MINLINE static inline
47 # if (defined(__APPLE__) && defined(__ppc__))
48 /* static inline __attribute__ here breaks osx ppc gcc42 build */
49 # define MALWAYS_INLINE static __attribute__((always_inline)) __attribute__((unused))
51 # define MALWAYS_INLINE static inline __attribute__((always_inline)) __attribute__((unused))
56 # define MALWAYS_INLINE
59 /* gcc 4.6 (supports push/pop) */
60 #if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406))
61 # define BLI_MATH_GCC_WARN_PRAGMA 1
68 #endif /* __BLI_MATH_INLINE_H__ */