X-Git-Url: https://ruderich.org/simon/gitweb/?p=coloredstderr%2Fcoloredstderr.git;a=blobdiff_plain;f=src%2Fcompiler.h;h=9e23e238efa2c30ec52e9be5a20f50b7ef097876;hp=3d92f2fac5f1e05eef2a93f4191e1dd489465df7;hb=0a2617527c9b46a587a8f34571a54347cd5c4b5a;hpb=048bd6f9e7f316aafede310ba273776d0086b8ed diff --git a/src/compiler.h b/src/compiler.h index 3d92f2f..9e23e23 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. */ +#undef __noinline +#undef __always_inline +#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)