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)
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)