Check __cplusplus in addition to _ISOMAC
Commit Message
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(-)
Comments
On Thu, May 11, 2017 at 10:17 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> When compiling for C++, only include <wctype/wctype.h> and nothing else.
>
> Any comments?
This is about to be superseded by the _ISOMAC-testsuite patch. One of
its effects is to make __cplusplus imply _ISOMAC. I plan to commit
that patch later today, unless an unexpected problem turns up in the
tests I'm running now.
zw
@@ -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);