Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/iso/string_iso.h
+++ new/usr/src/head/iso/string_iso.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /* Copyright (c) 1988 AT&T */
23 23 /* All Rights Reserved */
24 24
25 25
26 26 /*
27 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 + *
27 29 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
28 30 * Use is subject to license terms.
29 31 */
30 32
31 33 /*
32 34 * An application should not include this header directly. Instead it
33 35 * should be included only through the inclusion of other Sun headers.
34 36 *
35 37 * The contents of this header is limited to identifiers specified in the
36 38 * C Standard. Any new identifiers specified in future amendments to the
37 39 * C Standard must be placed in this header. If these new identifiers
38 40 * are required to also be in the C++ Standard "std" namespace, then for
39 41 * anything other than macro definitions, corresponding "using" directives
40 42 * must also be added to <string.h>.
41 43 */
42 44
43 45 #ifndef _ISO_STRING_ISO_H
44 46 #define _ISO_STRING_ISO_H
45 47
46 -#pragma ident "%Z%%M% %I% %E% SMI"
47 -
48 48 #include <sys/feature_tests.h>
49 49
50 50 #ifdef __cplusplus
51 51 extern "C" {
52 52 #endif
53 53
54 54 #if __cplusplus >= 199711L
55 55 namespace std {
56 56 #endif
57 57
58 58 #if !defined(_SIZE_T) || __cplusplus >= 199711L
59 59 #define _SIZE_T
60 60 #if defined(_LP64) || defined(_I32LPx)
61 61 typedef unsigned long size_t; /* size of something in bytes */
62 62 #else
63 63 typedef unsigned int size_t; /* (historical version) */
64 64 #endif
↓ open down ↓ |
7 lines elided |
↑ open up ↑ |
65 65 #endif /* !_SIZE_T */
66 66
67 67 #ifndef NULL
68 68 #if defined(_LP64)
69 69 #define NULL 0L
70 70 #else
71 71 #define NULL 0
72 72 #endif
73 73 #endif
74 74
75 -#if defined(__STDC__)
76 -
77 75 extern int memcmp(const void *, const void *, size_t);
78 76 extern void *memcpy(void *_RESTRICT_KYWD, const void *_RESTRICT_KYWD, size_t);
79 77 extern void *memmove(void *, const void *, size_t);
80 78 extern void *memset(void *, int, size_t);
81 79 extern char *strcat(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD);
82 80 extern int strcmp(const char *, const char *);
83 81 extern char *strcpy(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD);
84 82 extern int strcoll(const char *, const char *);
85 83 extern size_t strcspn(const char *, const char *);
86 84 extern char *strerror(int);
87 85 extern size_t strlen(const char *);
88 86 extern char *strncat(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t);
89 87 extern int strncmp(const char *, const char *, size_t);
90 88 extern char *strncpy(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t);
91 89 extern size_t strspn(const char *, const char *);
92 90 extern char *strtok(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD);
93 91 extern size_t strxfrm(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t);
94 92
95 93 /*
96 94 * The C++ Standard (ISO/IEC 14882:1998) specifies that each of the
97 95 * function signatures for the following functions be replaced by
98 96 * two declarations, both of which have the same behavior.
99 97 */
100 98 #if __cplusplus >= 199711L
101 99 extern const void *memchr(const void *, int, size_t);
102 100 #ifndef _MEMCHR_INLINE
103 101 #define _MEMCHR_INLINE
104 102 extern "C++" {
105 103 inline void *memchr(void * __s, int __c, size_t __n) {
106 104 return (void *)memchr((const void *)__s, __c, __n);
107 105 }
108 106 }
109 107 #endif /* _MEMCHR_INLINE */
110 108 extern const char *strchr(const char *, int);
111 109 #ifndef _STRCHR_INLINE
112 110 #define _STRCHR_INLINE
113 111 extern "C++" {
114 112 inline char *strchr(char *__s, int __c) {
115 113 return (char *)strchr((const char *)__s, __c);
116 114 }
117 115 }
118 116 #endif /* _STRCHR_INLINE */
119 117 extern const char *strpbrk(const char *, const char *);
120 118 #ifndef _STRPBRK_INLINE
121 119 #define _STRPBRK_INLINE
122 120 extern "C++" {
123 121 inline char *strpbrk(char *__s1, const char *__s2) {
124 122 return (char *)strpbrk((const char *)__s1, __s2);
125 123 }
126 124 }
127 125 #endif /* _STRPBRK_INLINE */
128 126 extern const char *strrchr(const char *, int);
129 127 #ifndef _STRRCHR_INLINE
130 128 #define _STRRCHR_INLINE
131 129 extern "C++" {
132 130 inline char *strrchr(char *__s, int __c) {
133 131 return (char *)strrchr((const char *)__s, __c);
134 132 }
135 133 }
136 134 #endif /* _STRRCHR_INLINE */
137 135 extern const char *strstr(const char *, const char *);
138 136 #ifndef _STRSTR_INLINE
139 137 #define _STRSTR_INLINE
140 138 extern "C++" {
141 139 inline char *strstr(char *__s1, const char *__s2) {
142 140 return (char *)strstr((const char *)__s1, __s2);
143 141 }
↓ open down ↓ |
57 lines elided |
↑ open up ↑ |
144 142 }
145 143 #endif /* _STRSTR_INLINE */
146 144 #else /* __cplusplus >= 199711L */
147 145 extern void *memchr(const void *, int, size_t);
148 146 extern char *strchr(const char *, int);
149 147 extern char *strpbrk(const char *, const char *);
150 148 extern char *strrchr(const char *, int);
151 149 extern char *strstr(const char *, const char *);
152 150 #endif /* __cplusplus >= 199711L */
153 151
154 -#else /* __STDC__ */
155 -
156 -extern void *memchr();
157 -extern int memcmp();
158 -extern void *memcpy();
159 -extern void *memmove();
160 -extern void *memset();
161 -extern char *strcat();
162 -extern char *strchr();
163 -extern int strcmp();
164 -extern int strcoll();
165 -extern char *strcpy();
166 -extern size_t strcspn();
167 -extern char *strerror();
168 -extern size_t strlen();
169 -extern char *strncat();
170 -extern int strncmp();
171 -extern char *strncpy();
172 -extern char *strpbrk();
173 -extern char *strrchr();
174 -extern size_t strspn();
175 -extern char *strstr();
176 -extern char *strtok();
177 -extern size_t strxfrm();
178 -
179 -#endif /* __STDC__ */
180 -
181 152 #if __cplusplus >= 199711L
182 153 }
183 154 #endif /* end of namespace std */
184 155
185 156 #ifdef __cplusplus
186 157 }
187 158 #endif
188 159
189 160 #endif /* _ISO_STRING_ISO_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX