summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Vu-Brugier <cvubrugier@fastmail.fm>2020-07-02 10:57:23 +0200
committerDavid Howells <dhowells@redhat.com>2020-07-06 18:00:28 +0100
commitb7cffce8cfa3453f2ccdfd28bcab4cf85af8e88d (patch)
tree0b5f0274c6a6aff6fd0337c44f90954e380fcc76
parent991c272062a4300bbd5fe22dce17ab2fb5126e3f (diff)
downloadkeyutils-b7cffce8cfa3453f2ccdfd28bcab4cf85af8e88d.tar.gz
Fix error when a C++ program is linked with libkeyutils
Declare all the functions as extern "C" in keyutils.h to instruct a C++ compiler that these functions are not mangled. Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm> Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--keyutils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/keyutils.h b/keyutils.h
index 8b34353..3f672bc 100644
--- a/keyutils.h
+++ b/keyutils.h
@@ -15,6 +15,10 @@
#include <sys/types.h>
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const char keyutils_version_string[];
extern const char keyutils_build_string[];
@@ -271,4 +275,8 @@ extern int recursive_session_key_scan(recursive_key_scanner_t func, void *data);
extern key_serial_t find_key_by_type_and_desc(const char *type, const char *desc,
key_serial_t destringid);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* KEYUTILS_H */