OSDN Git Service

The main part of the C++ support is the definition of __BEGIN_DECLS
authorDavid McCullough <davidm@snapgear.com>
Wed, 11 Jul 2001 13:33:21 +0000 (13:33 -0000)
committerDavid McCullough <davidm@snapgear.com>
Wed, 11 Jul 2001 13:33:21 +0000 (13:33 -0000)
and __END_DECLS in this file based on the __cplusplus define.

include/sys/cdefs.h

index 877746e..7df9f1e 100644 (file)
 
 #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