summaryrefslogtreecommitdiff
path: root/include/sys/cdefs.h
diff options
context:
space:
mode:
authorDavid McCullough <davidm@snapgear.com>2001-07-11 13:33:21 +0000
committerDavid McCullough <davidm@snapgear.com>2001-07-11 13:33:21 +0000
commit5882811b88767f26c75913ca2b2fffd05595a7b5 (patch)
tree0273495c9498f1a8a4d337ec8f3082bc0e884c6c /include/sys/cdefs.h
parent635c2432c74546f31e2d00de857c769ff16a0a4e (diff)
The main part of the C++ support is the definition of __BEGIN_DECLS
and __END_DECLS in this file based on the __cplusplus define.
Diffstat (limited to 'include/sys/cdefs.h')
-rw-r--r--include/sys/cdefs.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index 877746e47..7df9f1e52 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -20,9 +20,14 @@
#endif
-/* No C++ */
-#define __BEGIN_DECLS
-#define __END_DECLS
+/* C++ needs to know that types and declarations are C, not C++. */
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
/* GNUish things */
#define __CONSTVALUE