X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Fwimlib%2Fcompiler.h;h=d32d092b964dfda938aa82cd4343edb085e9e103;hb=6c7b1783191ffe324953aad63735843feda9f901;hp=5ee5a433dfb553a8dbd684ccad791262fab537dd;hpb=f3ab01445d6184f7c5ffd0251667de7ef7437f9a;p=wimlib diff --git a/include/wimlib/compiler.h b/include/wimlib/compiler.h index 5ee5a433..d32d092b 100644 --- a/include/wimlib/compiler.h +++ b/include/wimlib/compiler.h @@ -18,6 +18,10 @@ # endif # define _malloc_attribute __attribute__((malloc)) # define _warn_unused_result_attribute __attribute__((warn_unused_result)) +# define _aligned_attribute(size) __attribute__((aligned(size))) +# define likely(x) __builtin_expect(!!(x), 1) +# define unlikely(x) __builtin_expect(!!(x), 0) +# define inline inline __attribute__((always_inline)) #else # define WIMLIBAPI # define _always_inline_attribute inline @@ -26,6 +30,9 @@ # define _packed_attribute # define _malloc_attribute # define _warn_unused_result_attribute +# define _aligned_attribute(size) +# define likely(x) (x) +# define unlikely(x) (x) #endif /* __GNUC__ */ #endif /* _WIMLIB_COMPILER_H */