diff --git a/doc/internals/ebtree b/doc/internals/ebtree index dd1bedadd..3b624d46a 100644 --- a/doc/internals/ebtree +++ b/doc/internals/ebtree @@ -12,3 +12,5 @@ Also, some optimizations are not redefined if already known: REGPRM* and likely/unlikely which are used in ebtree are also used and defined in haproxy. Thus, we just conditionally define them. +Last, all eb*tree*.h have been adapted to support being included multiple +times, using #ifndef/#define/#endif. diff --git a/include/common/eb32tree.h b/include/common/eb32tree.h index 87c2f9807..f0c793035 100644 --- a/include/common/eb32tree.h +++ b/include/common/eb32tree.h @@ -17,6 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef _COMMON_EB32TREE_H +#define _COMMON_EB32TREE_H + #include "ebtree.h" @@ -511,3 +514,5 @@ __eb32i_insert(struct eb_root *root, struct eb32_node *new) { return new; } + +#endif /* _COMMON_EB32TREE_H */ diff --git a/include/common/eb64tree.h b/include/common/eb64tree.h index 242e2b12c..9a069ca53 100644 --- a/include/common/eb64tree.h +++ b/include/common/eb64tree.h @@ -17,6 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef _COMMON_EB64TREE_H +#define _COMMON_EB64TREE_H + #include "ebtree.h" @@ -532,3 +535,4 @@ __eb64i_insert(struct eb_root *root, struct eb64_node *new) { return new; } +#endif /* _COMMON_EB64TREE_H */ diff --git a/include/common/ebpttree.h b/include/common/ebpttree.h index 4908f8105..be164ad4c 100644 --- a/include/common/ebpttree.h +++ b/include/common/ebpttree.h @@ -17,6 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef _COMMON_EBPTTREE_H +#define _COMMON_EBPTTREE_H + #include "ebtree.h" @@ -315,3 +318,4 @@ __ebpt_insert(struct eb_root *root, struct ebpt_node *new) { return new; } +#endif /* _COMMON_EBPTTREE_H */ diff --git a/include/common/ebtree.h b/include/common/ebtree.h index 7a595b949..ebd1e918d 100644 --- a/include/common/ebtree.h +++ b/include/common/ebtree.h @@ -246,6 +246,8 @@ */ +#ifndef _COMMON_EBTREE_H +#define _COMMON_EBTREE_H #include @@ -716,6 +718,7 @@ static inline void __eb_delete(struct eb_node *node) void eb_delete(struct eb_node *node); REGPRM1 struct eb_node *eb_insert_dup(struct eb_node *sub, struct eb_node *new); +#endif /* _COMMON_EBTREE_H */ /* * Local variables: