diff options
-rw-r--r-- | riscv/common.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/riscv/common.h b/riscv/common.h index 3c523d0..d593df2 100644 --- a/riscv/common.h +++ b/riscv/common.h @@ -3,8 +3,13 @@ #ifndef _RISCV_COMMON_H #define _RISCV_COMMON_H -#define likely(x) __builtin_expect(x, 1) -#define unlikely(x) __builtin_expect(x, 0) +#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 NOINLINE __attribute__ ((noinline)) |