summaryrefslogtreecommitdiff
path: root/inotail.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2006-09-26 13:57:58 +0200
committerTobias Klauser <tklauser@xenon.tklauser.home>2006-09-26 13:57:58 +0200
commit4f05bf2e822687dd13eff9eacd467c3e21e5f9a7 (patch)
tree5539b2be9fd226d9266f1e30c9bd9d6829ff1ee9 /inotail.h
parent26cc319274f9f7e99a56d55c3fd0872e2e2527a1 (diff)
Define unlikely() only for GCC
Some compilers probably don't know __builtin_expect
Diffstat (limited to 'inotail.h')
-rw-r--r--inotail.h7
1 files 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 */