aboutsummaryrefslogtreecommitdiffstats
path: root/usbdrv/usbdrv.h
diff options
context:
space:
mode:
Diffstat (limited to 'usbdrv/usbdrv.h')
-rw-r--r--usbdrv/usbdrv.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/usbdrv/usbdrv.h b/usbdrv/usbdrv.h
index 3fe84d5..113854e 100644
--- a/usbdrv/usbdrv.h
+++ b/usbdrv/usbdrv.h
@@ -9,8 +9,6 @@
#ifndef __usbdrv_h_included__
#define __usbdrv_h_included__
-#include "usbconfig.h"
-#include "usbportability.h"
/*
Hardware Prerequisites:
@@ -117,6 +115,23 @@ USB messages, even if they address another (low-speed) device on the same bus.
*/
+
+#ifdef __cplusplus
+// This header should be included as C-header from C++ code. However if usbdrv.c
+// is incorporated into a C++ module with an include, function names are mangled
+// and this header must be parsed as C++ header, too. External modules should be
+// treated as C, though, because they are compiled separately as C code.
+extern "C" {
+#endif
+
+#include "usbconfig.h"
+#include "usbportability.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+
/* ------------------------------------------------------------------------- */
/* --------------------------- Module Interface ---------------------------- */
/* ------------------------------------------------------------------------- */