summaryrefslogtreecommitdiff
path: root/include/generic.h
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-11-13 16:28:15 -0800
committerPixel <pixel@nobis-crew.org>2009-11-13 16:28:15 -0800
commit8c415c3658e7f344dc803431726b50942e432702 (patch)
tree5fda308ffe4420e6d1ebd9df67e7535b8069ee5e /include/generic.h
parentc12806450806909177058eb8e7f85dcbd24cbf1c (diff)
BigClean: Input & Archive are a little bit more threadsafe now.
Diffstat (limited to 'include/generic.h')
-rw-r--r--include/generic.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/generic.h b/include/generic.h
index 44aa291..ace03e8 100644
--- a/include/generic.h
+++ b/include/generic.h
@@ -26,6 +26,14 @@
#pragma warning(disable:4996 4244 4267)
#endif
+#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
+
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>