]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Add likely/unlikely support for ICC and Clang
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Sun, 24 May 2015 17:53:41 +0000 (19:53 +0200)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Sun, 24 May 2015 17:53:41 +0000 (19:53 +0200)
zutil.h

diff --git a/zutil.h b/zutil.h
index 50565caccb25631e33b7eda17afcced297ee2987..0cb923fe57b1e259548a4bb91218302c9d1d7f60 100644 (file)
--- a/zutil.h
+++ b/zutil.h
@@ -160,7 +160,7 @@ void ZLIB_INTERNAL  zcfree  (void *opaque, void *ptr);
 #endif /* ZSWAP32 */
 
 /* Only enable likely/unlikely if the compiler is known to support it */
-#if defined(__GNUC__) && (__GNUC__ >= 3)
+#if (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__INTEL_COMPILER) || defined(__Clang__)
 #  ifndef likely
 #    define likely(x)      __builtin_expect(!!(x),1)
 #  endif