Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix countl_zero: replace __builtin_clzl with __builtin_clzll (#270)
GCC\Clang provide 3 overloads for __builtin_clz: int __builtin_clz (unsigned int x) int __builtin_clzl (unsigned long) int __builtin_clzll (unsigned long long) GCC and Clang can be used to build CharLS for Linux\macOS (LP64 data model) and Windows (LLP64 data model). Using __builtin_clzl (unsigned long) for 64 bits works for LP64 (long is 64 bits) but fails for the LLP64 data model (long is 32 bits) __builtin_clzll (unsigned long long) works for both the LP64 and the LLP64 data model (unsigned long long int is always at least 64 bits)
- Loading branch information