diff --git a/src/node.c b/src/node.c index c209f44..13ddddc 100644 --- a/src/node.c +++ b/src/node.c @@ -13,6 +13,13 @@ #include "slug.h" #include "zmalloc.h" +#ifdef __GNUC__ +# define likely(x) __builtin_expect(!!(x), 1) +# define unlikely(x) __builtin_expect(!!(x), 0) +#else +# define likely(x) !!(x) +# define unlikely(x) !!(x) +#endif #define CHECK_PTR(ptr) if (ptr == NULL) return NULL;