]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUILD] make ebtree headers multiple-include compatible
authorWilly Tarreau <w@1wt.eu>
Mon, 19 Nov 2007 17:43:04 +0000 (18:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 28 Nov 2007 13:23:05 +0000 (14:23 +0100)
ebtree did not support being included multiple times.

doc/internals/ebtree
include/common/eb32tree.h
include/common/eb64tree.h
include/common/ebpttree.h
include/common/ebtree.h

index dd1bedaddb6bb04aca5c5b91d276902cbba27bd4..3b624d46abc7927dda1a747cc121bcbf2414e308 100644 (file)
@@ -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.
index 87c2f980750006ae5aea781705d04d0e119f4f08..f0c79303574306bbec8534d6c92d80bf2507dddb 100644 (file)
@@ -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 */
index 242e2b12c6a951f4a67a33dbd2afb69de8003c49..9a069ca53f54bddac34de3fa6d5b57c72ea7c36d 100644 (file)
@@ -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 */
index 4908f810529c7582bbadccc7b4dbb36b6ab63a3c..be164ad4c8eec1fc22de650552e1d7383ad84929 100644 (file)
@@ -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 */
index 7a595b949bd329288b79a36103c41b8b025b12b6..ebd1e918d274a06bfadf9814f917615e35c027b8 100644 (file)
 
  */
 
+#ifndef _COMMON_EBTREE_H
+#define _COMMON_EBTREE_H
 
 #include <stdlib.h>
 
@@ -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: