From 34c5e58a6816ecfe9f944f5cf921261648324728 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Mon, 8 May 2017 08:01:05 +1000 Subject: util: move ALWAYS_INLINE macro to util/macro.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also added clang check. macro.h is include by p_compiler.h so no other change is needed. Reviewed-by: Nicolai Hähnle --- src/util/macros.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/util/macros.h') diff --git a/src/util/macros.h b/src/util/macros.h index 6f55ac667dd..a10f1de8145 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -136,6 +136,17 @@ do { \ #define MALLOCLIKE #endif +/* Forced function inlining */ +#ifndef ALWAYS_INLINE +# if defined(__GNUC__) || defined(__clang__) +# define ALWAYS_INLINE inline __attribute__((always_inline)) +# elif defined(_MSC_VER) +# define ALWAYS_INLINE __forceinline +# else +# define ALWAYS_INLINE inline +# endif +#endif + /* Used to optionally mark structures with misaligned elements or size as * packed, to trade off performance for space. */ -- cgit v1.2.3