util: move ALWAYS_INLINE macro to util/macro.h
authorTimothy Arceri <tarceri@itsqueeze.com>
Sun, 7 May 2017 22:01:05 +0000 (08:01 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 9 May 2017 01:21:03 +0000 (11:21 +1000)
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>
src/gallium/include/pipe/p_compiler.h
src/util/macros.h

index 0d7b0149583e1dbc397641b7c60bd1cdc2c0f28c..2869517389f9fd851a2059ded231c5878dbcc55a 100644 (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__
index 6f55ac667dd466ec040e6e2587c92d67cf070c59..a10f1de8145e14b72abb142aeda921cf7970b02c 100644 (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.
  */