From 6f3c4819ecf397cf9efee0213e628e15c1bc704d Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Tue, 10 Aug 2010 10:26:14 +0200 Subject: gallium: add ALWAYS_INLINE Used when we want to be sure the compiler inlines a large function into an inner loop. --- src/gallium/include/pipe/p_compiler.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gallium/include/pipe') diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index 0358c14e24b..1fa3ec8300a 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -102,6 +102,16 @@ typedef unsigned char boolean; # endif #endif +/* Forced function inlining */ +#ifndef ALWAYS_INLINE +# ifdef __GNUC__ +# define ALWAYS_INLINE inline __attribute__((always_inline)) +# elif defined(_MSC_VER) +# define ALWAYS_INLINE __forceinline +# else +# define ALWAYS_INLINE INLINE +# endif +#endif /* Function visibility */ #ifndef PUBLIC -- cgit v1.2.3