mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-04 20:23:40 +02:00
IMPORT: ebtree: only use __builtin_prefetch() when supported
It looks like __builtin_prefetch() appeared in gcc-3.1 as there's no
mention of it in 3.0's doc. Let's replace it with eb_prefetch() which
maps to __builtin_prefetch() on supported compilers and falls back to
the usual do{}while(0) on other ones. It was tested to properly build
with tcc as well as gcc-2.95.
This is ebtree commit 7ee6ede56a57a046cb552ed31302b93ff1a21b1a.
This commit is contained in:
@@ -499,6 +499,15 @@ __eb_insert_dup(struct eb_node *sub, struct eb_node *new)
|
||||
}
|
||||
}
|
||||
|
||||
/* __builtin_prefetch() appears in gcc-3.1 documentation */
|
||||
#if !defined(eb_prefetch)
|
||||
# if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
||||
# define eb_prefetch(a,b) __builtin_prefetch(a,b)
|
||||
# else
|
||||
# define eb_prefetch(a,b) do { } while (0)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************\
|
||||
* Public functions, for the end-user *
|
||||
|
||||
Reference in New Issue
Block a user