diff options
| author | Tyge Løvset <[email protected]> | 2023-02-04 23:24:54 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-04 23:24:54 +0100 |
| commit | d2ff84c53aa9bd3857fdf22dcf7cd9398a4780be (patch) | |
| tree | 4923f88afb0d091d5d39ae03d65a4998a0517652 /include/stc/cbits.h | |
| parent | 626b893b4d9e048c27571bfa28352914f2cd2bbc (diff) | |
| download | STC-modified-d2ff84c53aa9bd3857fdf22dcf7cd9398a4780be.tar.gz STC-modified-d2ff84c53aa9bd3857fdf22dcf7cd9398a4780be.zip | |
Fix in ccommon.h to make MSVC work again (without -std:c11) + small adjustments.
Diffstat (limited to 'include/stc/cbits.h')
| -rw-r--r-- | include/stc/cbits.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/stc/cbits.h b/include/stc/cbits.h index 9f0afc9c..577ecb13 100644 --- a/include/stc/cbits.h +++ b/include/stc/cbits.h @@ -60,10 +60,10 @@ int main() { #define _cbits_bytes(n) (_cbits_words(n) * c_sizeof(uint64_t)) #if defined(__GNUC__) || defined(__clang__) - STC_INLINE int cpopcount64(uint64_t x) {return (int)__builtin_popcountll(x);} + STC_INLINE int cpopcount64(uint64_t x) {return __builtin_popcountll(x);} #elif defined(_MSC_VER) && defined(_WIN64) #include <intrin.h> - STC_INLINE int cpopcount64(uint64_t x) {return __popcnt64(x);} + STC_INLINE int cpopcount64(uint64_t x) {return (int)__popcnt64(x);} #else STC_INLINE int cpopcount64(uint64_t x) { /* http://en.wikipedia.org/wiki/Hamming_weight */ x -= (x >> 1) & 0x5555555555555555; |
