This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Check __cplusplus in addition to _ISOMAC
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 11 May 2017 07:17:57 -0700
- Subject: [PATCH] Check __cplusplus in addition to _ISOMAC
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
When compiling for C++, only include <wctype/wctype.h> and nothing else.
Any comments?
H.J.
---
* include/wctype.h: Check __cplusplus in addition to _ISOMAC.
---
include/wctype.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/wctype.h b/include/wctype.h
index a71b103..74f9f47 100644
--- a/include/wctype.h
+++ b/include/wctype.h
@@ -1,6 +1,6 @@
#ifndef _WCTYPE_H
-#ifndef _ISOMAC
+#if !defined _ISOMAC && !defined __cplusplus
/* We try to get wint_t from <stddef.h>, but not all GCC versions define it
there. So define it ourselves if it remains undefined. */
# define __need_wint_t
@@ -38,7 +38,7 @@ libc_hidden_proto (towupper)
#include <wctype/wctype.h>
-#ifndef _ISOMAC
+#if !defined _ISOMAC && !defined __cplusplus
/* Internal interfaces. */
extern int __iswspace (wint_t __wc);
extern int __iswctype (wint_t __wc, wctype_t __desc);
--
2.9.3