[PATCH V2 05/11] Make the library callable from C++

Kevin Cernekee cernekee at gmail.com
Mon Feb 8 22:34:11 PST 2016


Add 'extern "C" { }' so that C++ users can include the header directly.

Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 openconnect.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/openconnect.h b/openconnect.h
index e8bcb95c16e2..d8b94c20c911 100644
--- a/openconnect.h
+++ b/openconnect.h
@@ -24,6 +24,10 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef _WIN32
 #define uid_t unsigned
 #endif
@@ -597,4 +601,8 @@ typedef int (*openconnect_getaddrinfo_vfn) (void *privdata, const char *node, co
 					    const struct addrinfo *hints, struct addrinfo **res);
 void openconnect_override_getaddrinfo(struct openconnect_info *vpninfo, openconnect_getaddrinfo_vfn gai_fn);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __OPENCONNECT_H__ */
-- 
2.7.0




More information about the openconnect-devel mailing list