diff options
| author | Tyge Løvset <[email protected]> | 2023-02-23 08:35:44 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-23 08:35:44 +0100 |
| commit | 4ff4c8d352f76b658214029988eab7ce1d69efe8 (patch) | |
| tree | b4344007993fdb6460b7d4ecd3536a7f1e2b91b6 /include/stc/cbits.h | |
| parent | 95f0b246cedc2d3669575ed2bfb398e6fbcb2b2f (diff) | |
| download | STC-modified-4ff4c8d352f76b658214029988eab7ce1d69efe8.tar.gz STC-modified-4ff4c8d352f76b658214029988eab7ce1d69efe8.zip | |
Internal updates.
Diffstat (limited to 'include/stc/cbits.h')
| -rw-r--r-- | include/stc/cbits.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/stc/cbits.h b/include/stc/cbits.h index e2d97f8c..fa0da665 100644 --- a/include/stc/cbits.h +++ b/include/stc/cbits.h @@ -61,8 +61,13 @@ int main() { #define _cbits_words(n) (i_ssize)(((n) + 63)>>6) #define _cbits_bytes(n) (_cbits_words(n) * c_sizeof(uint64_t)) -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) STC_INLINE int cpopcount64(uint64_t x) {return __builtin_popcountll(x);} + #ifndef __clang__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-overflow=" + #pragma GCC diagnostic ignored "-Walloc-size-larger-than=" + #endif #elif defined(_MSC_VER) && defined(_WIN64) #include <intrin.h> STC_INLINE int cpopcount64(uint64_t x) {return (int)__popcnt64(x);} @@ -303,7 +308,9 @@ STC_INLINE bool _i_memb(_disjoint)(const i_type* self, const i_type* other) { _i_assert(self->_size == other->_size); return _cbits_disjoint(self->data64, other->data64, _i_memb(_size)(self)); } - +#if defined __GNUC__ && !defined __clang__ +#pragma GCC diagnostic pop +#endif #define CBITS_H_INCLUDED #undef _i_size #undef _i_memb |
