summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_compiler.h
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-08-10 10:26:14 +0200
committerLuca Barbieri <[email protected]>2010-08-11 11:27:46 +0200
commit6f3c4819ecf397cf9efee0213e628e15c1bc704d (patch)
tree0d37f767a13637bdc27eb3aae0b4f461e40932af /src/gallium/include/pipe/p_compiler.h
parent5668526c915a1e31036386d117c536592dae6859 (diff)
gallium: add ALWAYS_INLINE
Used when we want to be sure the compiler inlines a large function into an inner loop.
Diffstat (limited to 'src/gallium/include/pipe/p_compiler.h')
-rw-r--r--src/gallium/include/pipe/p_compiler.h10
1 files changed, 10 insertions, 0 deletions
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