summaryrefslogtreecommitdiff
path: root/lib/gl_anytreehash_list1.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-08-16 18:36:57 +0200
committerBruno Haible <bruno@clisp.org>2020-08-16 18:36:57 +0200
commit852b8a9d6ede8cc71b95727b337166a5b70cecf5 (patch)
tree3e2dc0a07f957f4cf958927fd210c15db02f88a9 /lib/gl_anytreehash_list1.h
parent0fc41d2b9777053f57199426a1e14e6fa425d3c5 (diff)
downloadgnulib-852b8a9d6ede8cc71b95727b337166a5b70cecf5.tar.gz
avltreehash-list, rbtreehash-list: Optimize also on clang.
* lib/gl_anytreehash_list1.h (add_nodes_to_buckets): Use __builtin_expect also on clang.
Diffstat (limited to 'lib/gl_anytreehash_list1.h')
-rw-r--r--lib/gl_anytreehash_list1.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gl_anytreehash_list1.h b/lib/gl_anytreehash_list1.h
index aba45d6c59..88fac00373 100644
--- a/lib/gl_anytreehash_list1.h
+++ b/lib/gl_anytreehash_list1.h
@@ -340,7 +340,7 @@ add_nodes_to_buckets (gl_list_t list)
return -1;
}
/* Tell GCC that the likely return value is 0. */
-#if __GNUC__ >= 3
+#if (__GNUC__ >= 3) || (__clang_major__ >= 4)
# define add_nodes_to_buckets(list) \
__builtin_expect ((add_nodes_to_buckets) (list), 0)
#endif