From: Luca Barbieri Date: Tue, 10 Aug 2010 08:26:14 +0000 (+0200) Subject: gallium: add ALWAYS_INLINE X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f3c4819ecf397cf9efee0213e628e15c1bc704d;p=mesa.git gallium: add ALWAYS_INLINE Used when we want to be sure the compiler inlines a large function into an inner loop. --- 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