From 5882811b88767f26c75913ca2b2fffd05595a7b5 Mon Sep 17 00:00:00 2001 From: David McCullough Date: Wed, 11 Jul 2001 13:33:21 +0000 Subject: The main part of the C++ support is the definition of __BEGIN_DECLS and __END_DECLS in this file based on the __cplusplus define. --- include/sys/cdefs.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/sys') 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 -- cgit v1.2.3