summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathis Rosenhauer <rosenhauer@dkrz.de>2016-08-19 09:49:58 +0200
committerMathis Rosenhauer <rosenhauer@dkrz.de>2016-08-19 09:49:58 +0200
commit9bd2d0857cdc6375ad7570516f064eb264530378 (patch)
tree8c0bdc4176eac0398843ca7c1d56997279e5d660 /src
parent9e22ee5312be7c427cc6c5f176aa46aecf499477 (diff)
downloadlibaec-9bd2d0857cdc6375ad7570516f064eb264530378.tar.gz
libaec-9bd2d0857cdc6375ad7570516f064eb264530378.tar.bz2
libaec-9bd2d0857cdc6375ad7570516f064eb264530378.zip
OS X and clang fixes
Diffstat (limited to 'src')
-rw-r--r--src/decode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/decode.c b/src/decode.c
index 4efbee3..886228b 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -322,7 +322,10 @@ static inline uint32_t direct_get_fs(struct aec_stream *strm)
state->bitp = 56;
}
-#if HAVE_DECL___BUILTIN_CLZLL
+#ifndef __has_builtin
+#define __has_builtin(x) 0 /* Compatibility with non-clang compilers. */
+#endif
+#if HAVE_DECL___BUILTIN_CLZLL || __has_builtin(__builtin_clzll)
i = 63 - __builtin_clzll(state->acc);
#elif HAVE_BSR64
_BitScanReverse64(&i, state->acc);