summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rw-r--r--src/cli_objects.h8
-rw-r--r--src/cli_path_utils.h8
-rw-r--r--src/cli_val.h9
-rw-r--r--src/commit2.cpp (renamed from src/commit2.c)2
5 files changed, 28 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index a932d5e..ff384cb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,6 +11,7 @@ enumdir = $(datadir)/enumeration
AM_CFLAGS = -I src -Wall -I /usr/include/glib-2.0 -I /usr/lib/glib-2.0/include
AM_CXXFLAGS = -I src -Wall -Werror
+AM_CXXFLAGS += -I /usr/include/glib-2.0 -I /usr/lib/glib-2.0/include
AM_YFLAGS = -d --name-prefix=yy_`basename $* .y`_
AM_LFLAGS = --prefix=yy_`basename $* .l`_ -olex.yy.c
@@ -76,7 +77,7 @@ sbin_PROGRAMS += src/my_cli_bin
sbin_PROGRAMS += src/my_cli_shell_api
src_priority_SOURCES = src/priority.c
-src_my_commit_SOURCES = src/commit2.c
+src_my_commit_SOURCES = src/commit2.cpp
src_exe_action_SOURCES = src/exe_action.c
src_dump_SOURCES = src/dump_session.c
src_check_tmpl_SOURCES = src/check_tmpl.c
diff --git a/src/cli_objects.h b/src/cli_objects.h
index 889c772..e9ae12e 100644
--- a/src/cli_objects.h
+++ b/src/cli_objects.h
@@ -3,6 +3,10 @@
#include "cli_val.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* names of VYATTA env vars */
#define ENV_EDIT_LEVEL "VYATTA_EDIT_LEVEL"
#define ENV_TEMPLATE_LEVEL "VYATTA_TEMPLATE_LEVEL"
@@ -43,4 +47,8 @@ const char* get_tmpp(void);
void init_paths(boolean for_commit);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* CLI_OBJ_H */
diff --git a/src/cli_path_utils.h b/src/cli_path_utils.h
index 6fcceb8..39ac990 100644
--- a/src/cli_path_utils.h
+++ b/src/cli_path_utils.h
@@ -35,6 +35,10 @@
#if !defined(__CLI_PATH_UTILS__)
#define __CLI_PATH_UTILS__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*******************
* Type definitions
*
@@ -68,4 +72,8 @@ int clind_file_exists(const char* dir,const char* file);
char *clind_unescape(const char *name);
char* clind_quote(const char* s);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __CLI_PATH_UTILS__ */
diff --git a/src/cli_val.h b/src/cli_val.h
index dd5a52c..cd19471 100644
--- a/src/cli_val.h
+++ b/src/cli_val.h
@@ -4,6 +4,10 @@
#include <cli_cstore.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef FALSE
#define FALSE 0
#endif
@@ -120,4 +124,9 @@ int restore_output(void);
#else
#define DPRINT(fmt, arg...) while (0) { printf(fmt, ##arg); }
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/commit2.c b/src/commit2.cpp
index cc6e9b4..b0a57f4 100644
--- a/src/commit2.c
+++ b/src/commit2.cpp
@@ -19,7 +19,7 @@ boolean g_old_print_output = FALSE;
#define g_num_actions 5
-extern void g_type_init();
+extern "C" void g_type_init();
const int ActionOrder[g_num_actions] = {
// 4, //syntax