From b7cffce8cfa3453f2ccdfd28bcab4cf85af8e88d Mon Sep 17 00:00:00 2001 From: Christophe Vu-Brugier Date: Thu, 2 Jul 2020 10:57:23 +0200 Subject: 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 Signed-off-by: David Howells --- keyutils.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'keyutils.h') diff --git a/keyutils.h b/keyutils.h index 8b34353..3f672bc 100644 --- a/keyutils.h +++ b/keyutils.h @@ -15,6 +15,10 @@ #include #include +#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 */ -- cgit v1.2.1