diff --git a/userspace/engine/falco_utils.h b/userspace/engine/falco_utils.h index 37795e44..2642d732 100644 --- a/userspace/engine/falco_utils.h +++ b/userspace/engine/falco_utils.h @@ -17,6 +17,8 @@ limitations under the License. */ +#pragma once + #include #include #include @@ -24,7 +26,13 @@ limitations under the License. #include #include -#pragma once +#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 namespace falco {