summaryrefslogtreecommitdiffstats
path: root/src/trie.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-11-16 15:02:14 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-11-16 15:02:14 -0500
commit3604eeddb8a317c0745e92680d0405c645fbe247 (patch)
tree0ed68dd374d3f2626ae808620f2f171a86ee863b /src/trie.c
parent906b0e9742fc3cb7d0361e8a4350832f8d97ec15 (diff)
downloadbfs-3604eeddb8a317c0745e92680d0405c645fbe247.tar.xz
trie: Limit target_clones to glibc
Musl doesn't support ifuncs.
Diffstat (limited to 'src/trie.c')
-rw-r--r--src/trie.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/trie.c b/src/trie.c
index 4bbdf13..1434356 100644
--- a/src/trie.c
+++ b/src/trie.c
@@ -103,16 +103,16 @@
#include <stdlib.h>
#include <string.h>
-#if __has_attribute(target_clones) && (__i386__ || __x86_64__)
+#if CHAR_BIT != 8
+# error "This trie implementation assumes 8-bit bytes."
+#endif
+
+#if __GLIBC__ && __has_attribute(target_clones) && (__i386__ || __x86_64__)
# define TARGET_CLONES_POPCNT __attribute__((target_clones("popcnt", "default")))
#else
# define TARGET_CLONES_POPCNT
#endif
-#if CHAR_BIT != 8
-# error "This trie implementation assumes 8-bit bytes."
-#endif
-
/** Number of bits for the sparse array bitmap, aka the range of a nibble. */
#define BITMAP_BITS 16
/** The number of remaining bits in a word, to hold the offset. */