summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/stc/cbits.h4
-rw-r--r--include/stc/ccommon.h2
2 files changed, 3 insertions, 3 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;
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h
index 30184407..b8ea6316 100644
--- a/include/stc/ccommon.h
+++ b/include/stc/ccommon.h
@@ -52,7 +52,7 @@
/* Macro overloading feature support based on: https://rextester.com/ONP80107 */
#define c_MACRO_OVERLOAD(name, ...) \
- c_PASTE(name##_, c_NUMARGS(__VA_ARGS__))(__VA_ARGS__)
+ c_PASTE(c_CONCAT(name,_), c_NUMARGS(__VA_ARGS__))(__VA_ARGS__)
#define c_CONCAT(a, b) a ## b
#define c_PASTE(a, b) c_CONCAT(a, b)
#define c_EXPAND(...) __VA_ARGS__