summaryrefslogtreecommitdiff
path: root/libc/debian/patches/illumos-3787.patch
blob: 2bf0609e80567af7339ad8f1f7f81b344055ba3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
From 693e4d84eb49b987c3d66cbcd4b13a5c6e9059bf Mon Sep 17 00:00:00 2001
From: Alexander Pyhalov <apyhalov@gmail.com>
Date: Fri, 14 Jun 2013 10:16:47 +0400
Subject: [PATCH] 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>

---
 usr/src/head/iso/stdio_iso.h  |  6 ++----
 usr/src/head/iso/stdlib_iso.h | 10 ++++------
 usr/src/head/wchar.h          | 25 +++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/usr/src/head/iso/stdio_iso.h b/usr/src/head/iso/stdio_iso.h
index e2272c5..f974ad5 100644
--- a/usr/src/head/iso/stdio_iso.h
+++ b/usr/src/head/iso/stdio_iso.h
@@ -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 @@ extern size_t	fwrite(const void *_RESTRICT_KYWD, size_t, size_t,
 
 #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 @@ inline int putc(int _x, FILE *_p) {
 				(int)(*(p)->_ptr++ = (unsigned char) (x)))
 #endif	/* __STDC__ */
 
-#endif /* !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC) */
+#endif /* !defined(_REENTRANT) && !defined(_LP64) */
 
 #ifndef	_REENTRANT
 
diff --git a/usr/src/head/iso/stdlib_iso.h b/usr/src/head/iso/stdlib_iso.h
index 2a636c5..17577a9 100644
--- a/usr/src/head/iso/stdlib_iso.h
+++ b/usr/src/head/iso/stdlib_iso.h
@@ -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 @@ extern size_t mbstowcs(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
 	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);
diff --git a/usr/src/head/wchar.h b/usr/src/head/wchar.h
index 781b57a..b804698 100644
--- a/usr/src/head/wchar.h
+++ b/usr/src/head/wchar.h
@@ -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__) || \
-- 
1.8.1.6