aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--erts/emulator/beam/erl_map.c3
-rw-r--r--erts/emulator/beam/erl_map.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c
index b7f07fa6c4..964c09e906 100644
--- a/erts/emulator/beam/erl_map.c
+++ b/erts/emulator/beam/erl_map.c
@@ -2768,7 +2768,7 @@ static Eterm hashmap_bld_tuple_uint(Uint **hpp, Uint *szp, Uint n, Uint nums[])
/* implementation of builtin emulations */
-#if !defined(__GNUC__)
+#if !ERTS_AT_LEAST_GCC_VSN__(3, 4, 0)
/* Count leading zeros emulation */
Uint32 hashmap_clz(Uint32 x) {
Uint32 y;
@@ -2780,6 +2780,7 @@ Uint32 hashmap_clz(Uint32 x) {
y = x >> 1; if (y != 0) return n - 2;
return n - x;
}
+
const Uint32 SK5 = 0x55555555, SK3 = 0x33333333;
const Uint32 SKF0 = 0xF0F0F0F, SKFF = 0xFF00FF;
diff --git a/erts/emulator/beam/erl_map.h b/erts/emulator/beam/erl_map.h
index ff5e6edd1e..d075d87c83 100644
--- a/erts/emulator/beam/erl_map.h
+++ b/erts/emulator/beam/erl_map.h
@@ -24,7 +24,7 @@
#include "sys.h"
/* instrinsic wrappers */
-#if defined(__GNUC__)
+#if ERTS_AT_LEAST_GCC_VSN__(3, 4, 0)
#define hashmap_clz(x) ((Uint32) __builtin_clz((unsigned int)(x)))
#define hashmap_bitcount(x) ((Uint32) __builtin_popcount((unsigned int) (x)))
#else