From 4f05bf2e822687dd13eff9eacd467c3e21e5f9a7 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 26 Sep 2006 13:57:58 +0200 Subject: Define unlikely() only for GCC Some compilers probably don't know __builtin_expect --- inotail.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inotail.h b/inotail.h index f6e90e8..b47e6a4 100644 --- a/inotail.h +++ b/inotail.h @@ -24,7 +24,10 @@ struct file_struct { # define dprintf(fmt, args...) #endif /* DEBUG */ -/* Taken from linux kernel source tree */ -#define unlikely(x) __builtin_expect(!!(x), 0) +#ifdef __GNUC__ +# define unlikely(x) __builtin_expect(!!(x), 0) /* Taken from linux kernel source */ +#else +# define unlikely(x) (x) +#endif #endif /* _INOTAIL_H */ -- cgit v1.2.3-54-g00ecf