util: move ALWAYS_INLINE macro to util/macro.h

Also added clang check.

macro.h is include by p_compiler.h so no other change is needed.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Timothy Arceri
2017-05-08 08:01:05 +10:00
parent f52e63069a
commit 34c5e58a68
2 changed files with 11 additions and 11 deletions

View File

@@ -93,17 +93,6 @@ 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
/* XXX: Use standard `__func__` instead */
#ifndef __FUNCTION__

View File

@@ -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.
*/