summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-05-20 18:52:16 -0300
committerRenato Westphal <renato@opensourcerouting.org>2019-05-21 15:56:18 -0300
commiteea3c899cdb2aa58abea00c6d2e57b5bb0d74d49 (patch)
tree024e799896fe2d121c58ce57f65746d7bf364926
parent173c7642f2d7e1b2f897002c4cab3278a0730e22 (diff)
lib: add missing extern "C" {} blocks to new headers
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
-rw-r--r--lib/typerb.h8
-rw-r--r--lib/typesafe.h8
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/typerb.h b/lib/typerb.h
index 3d8db06fe0..ce8446f853 100644
--- a/lib/typerb.h
+++ b/lib/typerb.h
@@ -22,6 +22,10 @@
#include "typesafe.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct typed_rb_entry {
struct typed_rb_entry *rbt_parent;
struct typed_rb_entry *rbt_left;
@@ -179,4 +183,8 @@ macro_inline int prefix ## __cmp_uq(const struct typed_rb_entry *a, \
_DECLARE_RBTREE(prefix, type, field, prefix ## __cmp, prefix ## __cmp_uq) \
/* ... */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FRR_TYPERB_H */
diff --git a/lib/typesafe.h b/lib/typesafe.h
index 6df3a07efe..6829b0a388 100644
--- a/lib/typesafe.h
+++ b/lib/typesafe.h
@@ -23,6 +23,10 @@
#include <assert.h>
#include "compiler.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* generic macros for all list-like types */
#define for_each(prefix, head, item) \
@@ -850,6 +854,10 @@ extern void typesafe_skiplist_del(struct sskip_head *head,
const struct sskip_item *b));
extern struct sskip_item *typesafe_skiplist_pop(struct sskip_head *head);
+#ifdef __cplusplus
+}
+#endif
+
/* this needs to stay at the end because both files include each other.
* the resolved order is typesafe.h before typerb.h
*/