summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Senichev <artemsen@gmail.com>2019-02-22 16:06:08 +0300
committerAlistair Popple <alistair@popple.id.au>2019-03-26 11:55:59 +1100
commit12abf3f3546f20b74be64c51b634d2caab2fbd00 (patch)
tree38b2b3544e765a975eb9f0de9e7bb25089afedb7
parent39f85aac1ae5998407f6428b71d469a4520823f8 (diff)
downloadpdbg-12abf3f3546f20b74be64c51b634d2caab2fbd00.tar.gz
pdbg-12abf3f3546f20b74be64c51b634d2caab2fbd00.zip
api: Fix API interface for external usage
1. File 'ccan/short_types/short_types.h' is not used by external interface and should be used as internal dependency only (ccan directory is not installed by make script). 2. Extern "C" declaration of API allows us to call libpdbg functions from C++ modules. Signed-off-by: Artem Senichev <artemsen@gmail.com> Signed-off-by: Alistair Popple <alistair@popple.id.au>
-rw-r--r--libpdbg/libpdbg.h8
-rw-r--r--libpdbg/target.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h
index b332a7e..4fad158 100644
--- a/libpdbg/libpdbg.h
+++ b/libpdbg/libpdbg.h
@@ -8,7 +8,9 @@
#include <stdbool.h>
-#include <ccan/short_types/short_types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
struct pdbg_target;
struct pdbg_target_class;
@@ -244,4 +246,8 @@ void pdbg_set_logfunc(pdbg_log_func_t fn);
void pdbg_set_loglevel(int loglevel);
void pdbg_log(int loglevel, const char *fmt, ...);
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/libpdbg/target.h b/libpdbg/target.h
index eb8d564..04897ed 100644
--- a/libpdbg/target.h
+++ b/libpdbg/target.h
@@ -20,6 +20,7 @@
#include <ccan/list/list.h>
#include <ccan/str/str.h>
#include <ccan/container_of/container_of.h>
+#include <ccan/short_types/short_types.h>
#include "compiler.h"
#include "libpdbg.h"
OpenPOWER on IntegriCloud