]> err.no Git - systemd/commitdiff
libudev: wrap in extern "C" block for C++
authorDaniel Elstner <daniel.kitta@gmail.com>
Mon, 14 Dec 2009 20:15:20 +0000 (21:15 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 15 Dec 2009 11:49:25 +0000 (12:49 +0100)
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.

libudev/libudev.h

index 4bcf442f51fd42925e4360acfe63a51d4c254e97..ad11059f2c5c744927736a576e5fd9558da9e2b1 100644 (file)
 #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