X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fcompiler.h;h=5ede8b21802e3610eb4385640948feb5102896c9;hb=04334418fcce94a1b528bd4c935d8126876bda04;hp=3d92f2fac5f1e05eef2a93f4191e1dd489465df7;hpb=048bd6f9e7f316aafede310ba273776d0086b8ed;p=coloredstderr%2Fcoloredstderr.git diff --git a/src/compiler.h b/src/compiler.h index 3d92f2f..5ede8b2 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -20,6 +20,17 @@ #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)) +# define unused __attribute__((unused)) +#else +# define noinline +# define always_inline +# define unused +#endif + /* Branch prediction information for the compiler. */ #ifdef HAVE___BUILTIN_EXPECT # define likely(x) __builtin_expect(!!(x), 1)