mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-09 12:28:13 -04:00
Remove __has_builtin check which doesn't work for gcc-9
This commit is contained in:
parent
e947f47b9a
commit
7a75c29674
@ -56,20 +56,14 @@ uint8_t tran3(uint8_t a, uint8_t b, uint8_t c, uint8_t n) {
|
||||
return ((TT53[(a + n) & 0xFF] ^ TT53[b] * (n + n + 1)) + TT53[c ^ TT53[n]]);
|
||||
}
|
||||
|
||||
// TODO: this will currently only work for gcc/clang,
|
||||
// but should be easy to port
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_popcountl)
|
||||
// TODO: this will currently only work for gcc/clang, but should be easy to port
|
||||
__attribute__((__unused__)) int popcount(unsigned long x) {
|
||||
return __builtin_popcountl(x);
|
||||
}
|
||||
#endif
|
||||
#if __has_builtin(__builtin_popcountll)
|
||||
|
||||
__attribute__((__unused__)) int popcount(unsigned long long x) {
|
||||
return __builtin_popcountll(x);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // namespace
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user