changeset 14055:031a1c9c05cb

3787 gcc4.7 __cplusplus change incompatibility 3823 wchar.h and wctype_iso.h incompatibility Reviewed by: Albert Lee <trisk@nexenta.com> Approved by: Dan McDonald <danmcd@nexenta.com>
author Alexander Pyhalov <apyhalov@gmail.com>
date Fri, 14 Jun 2013 10:16:47 +0400
parents 0978afc523c5
children 812b3d1ca0a0
files usr/src/head/iso/stdio_iso.h usr/src/head/iso/stdlib_iso.h usr/src/head/wchar.h
diffstat 3 files changed, 31 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/head/iso/stdio_iso.h	Thu Jun 13 14:06:13 2013 -0400
+++ b/usr/src/head/iso/stdio_iso.h	Fri Jun 14 10:16:47 2013 +0400
@@ -46,8 +46,6 @@
 #ifndef _ISO_STDIO_ISO_H
 #define	_ISO_STDIO_ISO_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/feature_tests.h>
 #include <sys/va_list.h>
 #include <stdio_tag.h>
@@ -331,7 +329,7 @@
 
 #if !defined(__lint)
 
-#if	!defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC)
+#if	!defined(_REENTRANT) && !defined(_LP64)
 
 #ifdef	__STDC__
 #if __cplusplus >= 199711L
@@ -353,7 +351,7 @@
 				(int)(*(p)->_ptr++ = (unsigned char) (x)))
 #endif	/* __STDC__ */
 
-#endif /* !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC) */
+#endif /* !defined(_REENTRANT) && !defined(_LP64) */
 
 #ifndef	_REENTRANT
 
--- a/usr/src/head/iso/stdlib_iso.h	Thu Jun 13 14:06:13 2013 -0400
+++ b/usr/src/head/iso/stdlib_iso.h	Fri Jun 14 10:16:47 2013 +0400
@@ -43,8 +43,6 @@
 #ifndef _ISO_STDLIB_ISO_H
 #define	_ISO_STDLIB_ISO_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/feature_tests.h>
 
 #ifdef	__cplusplus
@@ -128,12 +126,12 @@
 extern long int atol(const char *);
 extern void *bsearch(const void *, const void *, size_t, size_t,
 	int (*)(const void *, const void *));
-#if __cplusplus >= 199711L
+#if __cplusplus >= 199711L && defined(__SUNPRO_CC)
 extern "C++" {
 	void *bsearch(const void *, const void *, size_t, size_t,
 		int (*)(const void *, const void *));
 }
-#endif /* __cplusplus >= 199711L */
+#endif /* __cplusplus >= 199711L && defined(__SUNPRO_CC) */
 extern void *calloc(size_t, size_t);
 extern div_t div(int, int);
 extern void exit(int)
@@ -148,11 +146,11 @@
 	size_t);
 extern int mbtowc(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t);
 extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
-#if __cplusplus >= 199711L
+#if __cplusplus >= 199711L && defined(__SUNPRO_CC)
 extern "C++" {
 	void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
 }
-#endif /* __cplusplus >= 199711L */
+#endif /* __cplusplus >= 199711L && defined(__SUNPRO_CC) */
 extern int rand(void);
 extern void *realloc(void *, size_t);
 extern void srand(unsigned int);
--- a/usr/src/head/wchar.h	Thu Jun 13 14:06:13 2013 -0400
+++ b/usr/src/head/wchar.h	Fri Jun 14 10:16:47 2013 +0400
@@ -122,6 +122,9 @@
 #ifdef __STDC__
 
 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
+#if __cplusplus >= 199711L
+namespace std {
+#endif
 extern int iswalpha(wint_t);
 extern int iswupper(wint_t);
 extern int iswlower(wint_t);
@@ -140,6 +143,28 @@
 extern int wcswidth(const wchar_t *, size_t);
 extern int wcwidth(wchar_t);
 extern wctype_t wctype(const char *);
+#if __cplusplus >= 199711L
+} /* namespace std */
+
+using std::iswalpha;
+using std::iswupper;
+using std::iswlower;
+using std::iswdigit;
+using std::iswxdigit;
+using std::iswalnum;
+using std::iswspace;
+using std::iswpunct;
+using std::iswprint;
+using std::iswgraph;
+using std::iswcntrl;
+using std::iswctype;
+using std::towlower;
+using std::towupper;
+using std::wcswcs;
+using std::wcswidth;
+using std::wcwidth;
+using std::wctype;
+#endif
 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
 
 #if defined(__EXTENSIONS__) || \