Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/iso/stdlib_iso.h
+++ new/usr/src/head/iso/stdlib_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.
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
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
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 /*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 26 * Use is subject to license terms.
25 27 */
26 -/*
27 - * Copyright 2013 Garrett D'Amore <garrett@damore.org>
28 - */
29 28
30 29 /* Copyright (c) 1988 AT&T */
31 30 /* All Rights Reserved */
32 31
33 32
34 33 /*
35 34 * An application should not include this header directly. Instead it
36 35 * should be included only through the inclusion of other Sun headers.
37 36 *
38 37 * The contents of this header is limited to identifiers specified in the
39 38 * C Standard. Any new identifiers specified in future amendments to the
40 39 * C Standard must be placed in this header. If these new identifiers
41 40 * are required to also be in the C++ Standard "std" namespace, then for
42 41 * anything other than macro definitions, corresponding "using" directives
43 42 * must also be added to <locale.h>.
44 43 */
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
45 44
46 45 #ifndef _ISO_STDLIB_ISO_H
47 46 #define _ISO_STDLIB_ISO_H
48 47
49 48 #include <sys/feature_tests.h>
50 49
51 50 #ifdef __cplusplus
52 51 extern "C" {
53 52 #endif
54 53
55 -#if defined(__STDC__)
56 54 unsigned char __mb_cur_max(void);
57 -#else
58 -unsigned char __mb_cur_max();
59 -#endif
60 55 #ifndef MB_CUR_MAX
61 56 #define MB_CUR_MAX (__mb_cur_max())
62 57 #endif
63 58
64 59 #if __cplusplus >= 199711L
65 60 namespace std {
66 61 #endif
67 62
68 63 typedef struct {
69 64 int quot;
70 65 int rem;
71 66 } div_t;
72 67
73 68 typedef struct {
74 69 long quot;
75 70 long rem;
76 71 } ldiv_t;
77 72
78 73 #if !defined(_SIZE_T) || __cplusplus >= 199711L
79 74 #define _SIZE_T
80 75 #if defined(_LP64) || defined(_I32LPx)
81 76 typedef unsigned long size_t; /* size of something in bytes */
82 77 #else
83 78 typedef unsigned int size_t; /* (historical version) */
84 79 #endif
85 80 #endif /* !_SIZE_T */
86 81
87 82 #ifndef NULL
88 83 #if defined(_LP64)
89 84 #define NULL 0L
90 85 #else
91 86 #define NULL 0
92 87 #endif
93 88 #endif
94 89
95 90 #define EXIT_FAILURE 1
96 91 #define EXIT_SUCCESS 0
97 92 #define RAND_MAX 32767
98 93
99 94 /*
100 95 * wchar_t is a built-in type in standard C++ and as such is not
101 96 * defined here when using standard C++. However, the GNU compiler
102 97 * fixincludes utility nonetheless creates its own version of this
103 98 * header for use by gcc and g++. In that version it adds a redundant
104 99 * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
105 100 * header we need to include the following magic comment:
106 101 *
107 102 * we must use the C++ compiler's type
108 103 *
109 104 * The above comment should not be removed or changed until GNU
110 105 * gcc/fixinc/inclhack.def is updated to bypass this header.
111 106 */
112 107 #if !defined(__cplusplus) || (__cplusplus < 199711L && !defined(__GNUG__))
↓ open down ↓ |
43 lines elided |
↑ open up ↑ |
113 108 #ifndef _WCHAR_T
114 109 #define _WCHAR_T
115 110 #if defined(_LP64)
116 111 typedef int wchar_t;
117 112 #else
118 113 typedef long wchar_t;
119 114 #endif
120 115 #endif /* !_WCHAR_T */
121 116 #endif /* !defined(__cplusplus) ... */
122 117
123 -#if defined(__STDC__)
124 -
125 118 extern void abort(void) __NORETURN;
126 119 extern int abs(int);
127 120 extern int atexit(void (*)(void));
128 121 extern double atof(const char *);
129 122 extern int atoi(const char *);
130 123 extern long int atol(const char *);
131 124 extern void *bsearch(const void *, const void *, size_t, size_t,
132 125 int (*)(const void *, const void *));
133 126 #if __cplusplus >= 199711L && defined(__SUNPRO_CC)
134 127 extern "C++" {
135 128 void *bsearch(const void *, const void *, size_t, size_t,
136 129 int (*)(const void *, const void *));
137 130 }
138 131 #endif /* __cplusplus >= 199711L && defined(__SUNPRO_CC) */
139 132 extern void *calloc(size_t, size_t);
140 133 extern div_t div(int, int);
141 134 extern void exit(int)
142 135 __NORETURN;
143 136 extern void free(void *);
144 137 extern char *getenv(const char *);
145 138 extern long int labs(long);
146 139 extern ldiv_t ldiv(long, long);
147 140 extern void *malloc(size_t);
148 141 extern int mblen(const char *, size_t);
149 142 extern size_t mbstowcs(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
150 143 size_t);
151 144 extern int mbtowc(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t);
152 145 extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
153 146 #if __cplusplus >= 199711L && defined(__SUNPRO_CC)
154 147 extern "C++" {
155 148 void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
156 149 }
157 150 #endif /* __cplusplus >= 199711L && defined(__SUNPRO_CC) */
158 151 extern int rand(void);
159 152 extern void *realloc(void *, size_t);
160 153 extern void srand(unsigned int);
161 154 extern double strtod(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD);
162 155 extern long int strtol(const char *_RESTRICT_KYWD, char **_RESTRICT_KYWD, int);
163 156 extern unsigned long int strtoul(const char *_RESTRICT_KYWD,
164 157 char **_RESTRICT_KYWD, int);
165 158 extern int system(const char *);
166 159 extern int wctomb(char *, wchar_t);
↓ open down ↓ |
32 lines elided |
↑ open up ↑ |
167 160 extern size_t wcstombs(char *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
168 161 size_t);
169 162
170 163 #if __cplusplus >= 199711L
171 164 extern "C++" {
172 165 inline long abs(long _l) { return labs(_l); }
173 166 inline ldiv_t div(long _l1, long _l2) { return ldiv(_l1, _l2); }
174 167 }
175 168 #endif /* __cplusplus */
176 169
177 -#else /* not __STDC__ */
178 -
179 -extern void abort();
180 -extern int abs();
181 -extern int atexit();
182 -extern double atof();
183 -extern int atoi();
184 -extern long int atol();
185 -extern void *bsearch();
186 -extern void *calloc();
187 -extern div_t div();
188 -extern void exit();
189 -extern void free();
190 -extern char *getenv();
191 -extern long int labs();
192 -extern ldiv_t ldiv();
193 -extern void *malloc();
194 -extern int mblen();
195 -extern size_t mbstowcs();
196 -extern int mbtowc();
197 -extern void qsort();
198 -extern int rand();
199 -extern void *realloc();
200 -extern void srand();
201 -extern double strtod();
202 -extern long int strtol();
203 -extern unsigned long strtoul();
204 -extern int system();
205 -extern int wctomb();
206 -extern size_t wcstombs();
207 -
208 -#endif /* __STDC__ */
209 -
210 170 #if __cplusplus >= 199711L
211 171 }
212 172 #endif /* end of namespace std */
213 173
214 174 #ifdef __cplusplus
215 175 }
216 176 #endif
217 177
218 178 #endif /* _ISO_STDLIB_ISO_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX