summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2017-01-25 14:44:07 -1000
committerMike Frysinger <vapier@gentoo.org>2017-01-25 14:47:24 -1000
commit3b68244ddce256fa9637d75cab0e001a711dfb46 (patch)
tree8e4fa49ce3db6e4ac004582ff9ebe71a3d2a8eb3 /sys-apps/keyutils/files
parentapp-eselect/eselect-opengl: Drop old. (diff)
downloadgentoo-3b68244ddce256fa9637d75cab0e001a711dfb46.tar.gz
gentoo-3b68244ddce256fa9637d75cab0e001a711dfb46.tar.bz2
gentoo-3b68244ddce256fa9637d75cab0e001a711dfb46.zip
sys-apps/keyutils: fix extern C markings in keyutils.h
Diffstat (limited to 'sys-apps/keyutils/files')
-rw-r--r--sys-apps/keyutils/files/keyutils-1.5.9-header-extern-c.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/sys-apps/keyutils/files/keyutils-1.5.9-header-extern-c.patch b/sys-apps/keyutils/files/keyutils-1.5.9-header-extern-c.patch
new file mode 100644
index 000000000000..c7a4c1034c90
--- /dev/null
+++ b/sys-apps/keyutils/files/keyutils-1.5.9-header-extern-c.patch
@@ -0,0 +1,43 @@
+sent upstream
+
+From 1f15000ad21c301a51f7746eb561659348060f45 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Wed, 25 Jan 2017 14:06:55 -1000
+Subject: [PATCH keyutils] add extern C markings to header file for C++ users
+
+If people try to use keyutils from C++ code, the header doesn't work
+properly because the compiler mangles the keyutils symbols. Add the
+right extern markings so it works out of the box.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ keyutils.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/keyutils.h b/keyutils.h
+index a69fa7aaa11d..d50d19d3e929 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[];
+
+@@ -180,4 +184,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 */
+--
+2.11.0
+