ubus: make libubus ready for linking into C++
authorPeter Stadler <peter.stadler@student.uibk.ac.at>
Sat, 7 Dec 2019 11:45:47 +0000 (12:45 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 5 Jan 2020 16:34:03 +0000 (17:34 +0100)
Use extern "C" { ... } if using libubus.h in a C++ project.

Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
libubus.h

index dc42ea78171a14608716911390676025ef9f80fd..6925514adb0fcea7929e52f67adabc04cbeacfaa 100644 (file)
--- a/libubus.h
+++ b/libubus.h
 #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