diff options
author | Christophe Vu-Brugier <cvubrugier@fastmail.fm> | 2020-07-02 10:57:23 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2020-07-06 18:00:28 +0100 |
commit | b7cffce8cfa3453f2ccdfd28bcab4cf85af8e88d (patch) | |
tree | 0b5f0274c6a6aff6fd0337c44f90954e380fcc76 /keyutils.h | |
parent | 991c272062a4300bbd5fe22dce17ab2fb5126e3f (diff) | |
download | keyutils-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>
Diffstat (limited to 'keyutils.h')
-rw-r--r-- | keyutils.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 */ |