summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stadler <peter.stadler@student.uibk.ac.at>2019-12-07 12:45:47 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2020-01-05 17:34:03 +0100
commitd35df8adda873dc75d876f72b78e84db8cfa72ee (patch)
tree9e9698df46fe989924d83f9f61a16434aa045a17
parent041c9d1c052bb4936fd03240f7d0dd64aedda972 (diff)
downloadubus-d35df8adda873dc75d876f72b78e84db8cfa72ee.tar.gz
ubus: make libubus ready for linking into C++
Use extern "C" { ... } if using libubus.h in a C++ project. Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
-rw-r--r--libubus.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libubus.h b/libubus.h
index dc42ea7..6925514 100644
--- a/libubus.h
+++ b/libubus.h
@@ -14,6 +14,10 @@
#ifndef __LIBUBUS_H
#define __LIBUBUS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <libubox/avl.h>
#include <libubox/list.h>
#include <libubox/blobmsg.h>
@@ -414,4 +418,8 @@ static inline int ubus_unregister_event_handler(struct ubus_context *ctx,
return ubus_remove_object(ctx, &ev->obj);
}
+#ifdef __cplusplus
+}
+#endif
+
#endif