From 5e2444690bd0d2003e7d283f890b33e11ddd371f Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Thu, 7 Feb 2019 20:10:31 -0200 Subject: lib: add extern "C" {} blocks to all libfrr headers These are necessary to use functions defined in these headers from C++. Signed-off-by: David Lamparter Signed-off-by: Renato Westphal --- lib/command_match.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/command_match.h') diff --git a/lib/command_match.h b/lib/command_match.h index c636d2dd95..547f6f3b6d 100644 --- a/lib/command_match.h +++ b/lib/command_match.h @@ -28,6 +28,10 @@ #include "linklist.h" #include "command.h" +#ifdef __cplusplus +extern "C" { +#endif + /* These definitions exist in command.c in the current engine but should be * relocated here in the new engine */ @@ -98,4 +102,8 @@ enum matcher_rv command_match(struct graph *cmdgraph, vector vline, enum matcher_rv command_complete(struct graph *cmdgraph, vector vline, struct list **completions); +#ifdef __cplusplus +} +#endif + #endif /* _ZEBRA_COMMAND_MATCH_H */ -- cgit v1.2.3 From c139972c0ffcabe73cafc3d20f257163fa81ddd0 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Mon, 11 Feb 2019 16:01:32 -0200 Subject: lib: rename enum to avoid conflict Two different definitions of "enum filter_type" exist in libfrr: one in lib/filter.h and other in lib/command_match.h. Rename one of them to resolve a conflict that happens when both headers are included by the same file. Signed-off-by: Renato Westphal --- lib/command.c | 2 +- lib/command_match.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/command_match.h') diff --git a/lib/command.c b/lib/command.c index 06879f6854..b46241ac87 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1009,7 +1009,7 @@ enum node_type node_parent(enum node_type node) } /* Execute command by argument vline vector. */ -static int cmd_execute_command_real(vector vline, enum filter_type filter, +static int cmd_execute_command_real(vector vline, enum cmd_filter_type filter, struct vty *vty, const struct cmd_element **cmd) { diff --git a/lib/command_match.h b/lib/command_match.h index 547f6f3b6d..fcb333120f 100644 --- a/lib/command_match.h +++ b/lib/command_match.h @@ -35,7 +35,7 @@ extern "C" { /* These definitions exist in command.c in the current engine but should be * relocated here in the new engine */ -enum filter_type { FILTER_RELAXED, FILTER_STRICT }; +enum cmd_filter_type { FILTER_RELAXED, FILTER_STRICT }; /* matcher result value */ enum matcher_rv { -- cgit v1.2.3