]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/blobdiff - src/compiler.h
Rename __noinline/__always_inline to prevent clash with headers.
[coloredstderr/coloredstderr.git] / src / compiler.h
index 3d92f2fac5f1e05eef2a93f4191e1dd489465df7..4a69adf066c59cacd63caea63ec8110dd43fff39 100644 (file)
 #ifndef COMPILER_H
 #define COMPILER_H 1
 
+/* Prevent/force inlining. Used to improve performance. */
+#ifdef HAVE___ATTRIBUTE__
+# define noinline      __attribute__((noinline))
+# define always_inline __attribute__((always_inline))
+#else
+# define noinline
+# define always_inline
+#endif
+
 /* Branch prediction information for the compiler. */
 #ifdef HAVE___BUILTIN_EXPECT
 # define likely(x)   __builtin_expect(!!(x), 1)