mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 04:50:31 -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]]);
|
return ((TT53[(a + n) & 0xFF] ^ TT53[b] * (n + n + 1)) + TT53[c ^ TT53[n]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: this will currently only work for gcc/clang,
|
// TODO: this will currently only work for gcc/clang, but should be easy to port
|
||||||
// but should be easy to port
|
|
||||||
#if defined(__has_builtin)
|
|
||||||
#if __has_builtin(__builtin_popcountl)
|
|
||||||
__attribute__((__unused__)) int popcount(unsigned long x) {
|
__attribute__((__unused__)) int popcount(unsigned long x) {
|
||||||
return __builtin_popcountl(x);
|
return __builtin_popcountl(x);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#if __has_builtin(__builtin_popcountll)
|
|
||||||
__attribute__((__unused__)) int popcount(unsigned long long x) {
|
__attribute__((__unused__)) int popcount(unsigned long long x) {
|
||||||
return __builtin_popcountll(x);
|
return __builtin_popcountll(x);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user