summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Elstner <daniel.kitta@gmail.com>2009-12-14 21:15:20 +0100
committerKay Sievers <kay.sievers@vrfy.org>2009-12-15 12:49:25 +0100
commit3fac12b9a05f1849f7b1373060ade18269839856 (patch)
tree7f9d2d45ecce40b9fbafdabaa0a8945a9d47f3ba
parent9c0c2fe6bb6c3e73d54c65149657dcfdba9b20b0 (diff)
libudev: wrap in extern "C" block for C++
When libudev.h is included from C++ code, wrap the declarations in an extern "C" { ... } block. This tells the C++ compiler that symbols are exported with C linkage and no name-mangling.
-rw-r--r--libudev/libudev.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libudev/libudev.h b/libudev/libudev.h
index 4bcf442f51..ad11059f2c 100644
--- a/libudev/libudev.h
+++ b/libudev/libudev.h
@@ -16,6 +16,10 @@
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* udev - library context
*
@@ -158,4 +162,9 @@ int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue,
unsigned long long int start, unsigned long long int end);
struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev_queue);
struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev_queue);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif