1 | /*␊ |
2 | * Copyright (c) 2000-2009 Apple Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * This file contains Original Code and/or Modifications of Original Code␊ |
7 | * as defined in and that are subject to the Apple Public Source License␊ |
8 | * Version 2.0 (the 'License'). You may not use this file except in␊ |
9 | * compliance with the License. The rights granted to you under the License␊ |
10 | * may not be used to create, or enable the creation or redistribution of,␊ |
11 | * unlawful or unlicensed copies of an Apple operating system, or to␊ |
12 | * circumvent, violate, or enable the circumvention or violation of, any␊ |
13 | * terms of an Apple operating system software license agreement.␊ |
14 | * ␊ |
15 | * Please obtain a copy of the License at␊ |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file.␊ |
17 | * ␊ |
18 | * The Original Code and all software distributed under the License are␊ |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
23 | * Please see the License for the specific language governing rights and␊ |
24 | * limitations under the License.␊ |
25 | * ␊ |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@␊ |
27 | */␊ |
28 | /* Copyright 1995 NeXT Computer, Inc. All rights reserved. */␊ |
29 | /*␊ |
30 | * Copyright (c) 1991, 1993␊ |
31 | *␉The Regents of the University of California. All rights reserved.␊ |
32 | *␊ |
33 | * This code is derived from software contributed to Berkeley by␊ |
34 | * Berkeley Software Design, Inc.␊ |
35 | *␊ |
36 | * Redistribution and use in source and binary forms, with or without␊ |
37 | * modification, are permitted provided that the following conditions␊ |
38 | * are met:␊ |
39 | * 1. Redistributions of source code must retain the above copyright␊ |
40 | * notice, this list of conditions and the following disclaimer.␊ |
41 | * 2. Redistributions in binary form must reproduce the above copyright␊ |
42 | * notice, this list of conditions and the following disclaimer in the␊ |
43 | * documentation and/or other materials provided with the distribution.␊ |
44 | * 3. All advertising materials mentioning features or use of this software␊ |
45 | * must display the following acknowledgement:␊ |
46 | *␉This product includes software developed by the University of␊ |
47 | *␉California, Berkeley and its contributors.␊ |
48 | * 4. Neither the name of the University nor the names of its contributors␊ |
49 | * may be used to endorse or promote products derived from this software␊ |
50 | * without specific prior written permission.␊ |
51 | *␊ |
52 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND␊ |
53 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE␊ |
54 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE␊ |
55 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE␊ |
56 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL␊ |
57 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS␊ |
58 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)␊ |
59 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT␊ |
60 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY␊ |
61 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF␊ |
62 | * SUCH DAMAGE.␊ |
63 | *␊ |
64 | *␉@(#)cdefs.h␉8.8 (Berkeley) 1/9/95␊ |
65 | */␊ |
66 | ␊ |
67 | #ifndef␉_CDEFS_H_␊ |
68 | #define␉_CDEFS_H_␊ |
69 | ␊ |
70 | #if defined(__cplusplus)␊ |
71 | #define␉__BEGIN_DECLS␉extern "C" {␊ |
72 | #define␉__END_DECLS␉}␊ |
73 | #else␊ |
74 | #define␉__BEGIN_DECLS␊ |
75 | #define␉__END_DECLS␊ |
76 | #endif␊ |
77 | ␊ |
78 | /* This SDK is designed to work with clang and specific versions of␊ |
79 | * gcc >= 4.0 with Apple's patch sets */␊ |
80 | #if !defined(__GNUC__) || __GNUC__ < 4␊ |
81 | #warning "Unsupported compiler detected"␊ |
82 | #endif␊ |
83 | ␊ |
84 | /*␊ |
85 | * The __CONCAT macro is used to concatenate parts of symbol names, e.g.␊ |
86 | * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.␊ |
87 | * The __CONCAT macro is a bit tricky -- make sure you don't put spaces␊ |
88 | * in between its arguments. __CONCAT can also concatenate double-quoted␊ |
89 | * strings produced by the __STRING macro, but this only works with ANSI C.␊ |
90 | */␊ |
91 | #if defined(__STDC__) || defined(__cplusplus)␊ |
92 | #define␉__P(protos)␉protos␉␉/* full-blown ANSI C */␊ |
93 | #define␉__CONCAT(x,y)␉x ## y␊ |
94 | #define␉__STRING(x)␉#x␊ |
95 | ␊ |
96 | #define␉__const␉␉const␉␉/* define reserved names to standard */␊ |
97 | #define␉__signed␉signed␊ |
98 | #define␉__volatile␉volatile␊ |
99 | #if defined(__cplusplus)␊ |
100 | #define␉__inline␉inline␉␉/* convert to C++ keyword */␊ |
101 | #else␊ |
102 | #ifndef __GNUC__␊ |
103 | #define␉__inline␉␉␉/* delete GCC keyword */␊ |
104 | #endif /* !__GNUC__ */␊ |
105 | #endif /* !__cplusplus */␊ |
106 | ␊ |
107 | #else␉/* !(__STDC__ || __cplusplus) */␊ |
108 | #define␉__P(protos)␉()␉␉/* traditional C preprocessor */␊ |
109 | #define␉__CONCAT(x,y)␉x/**/y␊ |
110 | #define␉__STRING(x)␉"x"␊ |
111 | ␊ |
112 | #ifndef __GNUC__␊ |
113 | #define␉__const␉␉␉␉/* delete pseudo-ANSI C keywords */␊ |
114 | #define␉__inline␊ |
115 | #define␉__signed␊ |
116 | #define␉__volatile␊ |
117 | #endif␉/* !__GNUC__ */␊ |
118 | ␊ |
119 | /*␊ |
120 | * In non-ANSI C environments, new programs will want ANSI-only C keywords␊ |
121 | * deleted from the program and old programs will want them left alone.␊ |
122 | * When using a compiler other than gcc, programs using the ANSI C keywords␊ |
123 | * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.␊ |
124 | * When using "gcc -traditional", we assume that this is the intent; if␊ |
125 | * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.␊ |
126 | */␊ |
127 | #ifndef␉NO_ANSI_KEYWORDS␊ |
128 | #define␉const␉␉__const␉␉␉/* convert ANSI C keywords */␊ |
129 | #define␉inline␉␉__inline␊ |
130 | #define␉signed␉␉__signed␊ |
131 | #define␉volatile␉__volatile␊ |
132 | #endif /* !NO_ANSI_KEYWORDS */␊ |
133 | #endif /* !(__STDC__ || __cplusplus) */␊ |
134 | ␊ |
135 | #define __dead2␉␉__attribute__((noreturn))␊ |
136 | #define __pure2␉␉__attribute__((const))␊ |
137 | ␊ |
138 | /* __unused denotes variables and functions that may not be used, preventing␊ |
139 | * the compiler from warning about it if not used.␊ |
140 | */␊ |
141 | #define __unused␉__attribute__((unused))␊ |
142 | ␊ |
143 | /* __used forces variables and functions to be included even if it appears␊ |
144 | * to the compiler that they are not used (and would thust be discarded).␊ |
145 | */␊ |
146 | #define __used␉␉__attribute__((used))␊ |
147 | ␊ |
148 | /* __deprecated causes the compiler to produce a warning when encountering␊ |
149 | * code using the deprecated functionality. This may require turning on␊ |
150 | * such wardning with the -Wdeprecated flag.␊ |
151 | */␊ |
152 | #define __deprecated␉__attribute__((deprecated))␊ |
153 | ␊ |
154 | /* __unavailable causes the compiler to error out when encountering␊ |
155 | * code using the tagged function of variable.␊ |
156 | */␊ |
157 | #define __unavailable␉__attribute__((unavailable))␊ |
158 | ␊ |
159 | /* Delete pseudo-keywords wherever they are not available or needed. */␊ |
160 | #ifndef __dead␊ |
161 | #define␉__dead␊ |
162 | #define␉__pure␊ |
163 | #endif␊ |
164 | ␊ |
165 | /*␊ |
166 | * We use `__restrict' as a way to define the `restrict' type qualifier␊ |
167 | * without disturbing older software that is unaware of C99 keywords.␊ |
168 | */␊ |
169 | #if __STDC_VERSION__ < 199901␊ |
170 | #define __restrict␊ |
171 | #else␊ |
172 | #define __restrict␉restrict␊ |
173 | #endif␊ |
174 | ␊ |
175 | /*␊ |
176 | * Compiler-dependent macros to declare that functions take printf-like␊ |
177 | * or scanf-like arguments. They are null except for versions of gcc␊ |
178 | * that are known to support the features properly. Functions declared␊ |
179 | * with these attributes will cause compilation warnings if there is a␊ |
180 | * mismatch between the format string and subsequent function parameter␊ |
181 | * types.␊ |
182 | */␊ |
183 | #define __printflike(fmtarg, firstvararg) \␊ |
184 | ␉␉__attribute__((__format__ (__printf__, fmtarg, firstvararg)))␊ |
185 | #define __scanflike(fmtarg, firstvararg) \␊ |
186 | ␉␉__attribute__((__format__ (__scanf__, fmtarg, firstvararg)))␊ |
187 | ␊ |
188 | #define __IDSTRING(name,string) static const char name[] __used = string␊ |
189 | ␊ |
190 | #ifndef __COPYRIGHT␊ |
191 | #define __COPYRIGHT(s) __IDSTRING(copyright,s)␊ |
192 | #endif␊ |
193 | ␊ |
194 | #ifndef __RCSID␊ |
195 | #define __RCSID(s) __IDSTRING(rcsid,s)␊ |
196 | #endif␊ |
197 | ␊ |
198 | #ifndef __SCCSID␊ |
199 | #define __SCCSID(s) __IDSTRING(sccsid,s)␊ |
200 | #endif␊ |
201 | ␊ |
202 | #ifndef __PROJECT_VERSION␊ |
203 | #define __PROJECT_VERSION(s) __IDSTRING(project_version,s)␊ |
204 | #endif␊ |
205 | ␊ |
206 | /* Source compatibility only, ID string not emitted in object file */␊ |
207 | #ifndef __FBSDID␊ |
208 | #define __FBSDID(s) ␊ |
209 | #endif␊ |
210 | ␊ |
211 | ␊ |
212 | /*␊ |
213 | * COMPILATION ENVIRONMENTS -- see compat(5) for additional detail␊ |
214 | *␊ |
215 | * DEFAULT␉By default newly complied code will get POSIX APIs plus␊ |
216 | *␉␉Apple API extensions in scope.␊ |
217 | *␊ |
218 | *␉␉Most users will use this compilation environment to avoid␊ |
219 | *␉␉behavioral differences between 32 and 64 bit code.␊ |
220 | *␊ |
221 | * LEGACY␉Defining _NONSTD_SOURCE will get pre-POSIX APIs plus Apple␊ |
222 | *␉␉API extensions in scope.␊ |
223 | *␊ |
224 | *␉␉This is generally equivalent to the Tiger release compilation␊ |
225 | *␉␉environment, except that it cannot be applied to 64 bit code;␊ |
226 | *␉␉its use is discouraged.␊ |
227 | *␊ |
228 | *␉␉We expect this environment to be deprecated in the future.␊ |
229 | *␊ |
230 | * STRICT␉Defining _POSIX_C_SOURCE or _XOPEN_SOURCE restricts the␊ |
231 | *␉␉available APIs to exactly the set of APIs defined by the␊ |
232 | *␉␉corresponding standard, based on the value defined.␊ |
233 | *␊ |
234 | *␉␉A correct, portable definition for _POSIX_C_SOURCE is 200112L.␊ |
235 | *␉␉A correct, portable definition for _XOPEN_SOURCE is 600L.␊ |
236 | *␊ |
237 | *␉␉Apple API extensions are not visible in this environment,␊ |
238 | *␉␉which can cause Apple specific code to fail to compile,␊ |
239 | *␉␉or behave incorrectly if prototypes are not in scope or␊ |
240 | *␉␉warnings about missing prototypes are not enabled or ignored.␊ |
241 | *␊ |
242 | * In any compilation environment, for correct symbol resolution to occur,␊ |
243 | * function prototypes must be in scope. It is recommended that all Apple␊ |
244 | * tools users add either the "-Wall" or "-Wimplicit-function-declaration"␊ |
245 | * compiler flags to their projects to be warned when a function is being␊ |
246 | * used without a prototype in scope.␊ |
247 | */␊ |
248 | ␊ |
249 | /* These settings are particular to each product. */␊ |
250 | /* Platform: MacOSX */␊ |
251 | #define __DARWIN_ONLY_64_BIT_INO_T␉0␊ |
252 | /* #undef __DARWIN_ONLY_UNIX_CONFORMANCE (automatically set for 64-bit) */␊ |
253 | #define __DARWIN_ONLY_VERS_1050␉␉0␊ |
254 | ␊ |
255 | /*␊ |
256 | * The __DARWIN_ALIAS macros are used to do symbol renaming; they allow␊ |
257 | * legacy code to use the old symbol, thus maintaining binary compatibility␊ |
258 | * while new code can use a standards compliant version of the same function.␊ |
259 | *␊ |
260 | * __DARWIN_ALIAS is used by itself if the function signature has not␊ |
261 | * changed, it is used along with a #ifdef check for __DARWIN_UNIX03␊ |
262 | * if the signature has changed. Because the __LP64__ environment␊ |
263 | * only supports UNIX03 semantics it causes __DARWIN_UNIX03 to be␊ |
264 | * defined, but causes __DARWIN_ALIAS to do no symbol mangling.␊ |
265 | *␊ |
266 | * As a special case, when XCode is used to target a specific version of the␊ |
267 | * OS, the manifest constant __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__␊ |
268 | * will be defined by the compiler, with the digits representing major version␊ |
269 | * time 100 + minor version times 10 (e.g. 10.5 := 1050). If we are targeting␊ |
270 | * pre-10.5, and it is the default compilation environment, revert the␊ |
271 | * compilation environment to pre-__DARWIN_UNIX03.␊ |
272 | */␊ |
273 | #if !defined(__DARWIN_ONLY_UNIX_CONFORMANCE)␊ |
274 | # if defined(__LP64__)␊ |
275 | # define __DARWIN_ONLY_UNIX_CONFORMANCE 1␊ |
276 | # else /* !__LP64__ */␊ |
277 | # define __DARWIN_ONLY_UNIX_CONFORMANCE 0␊ |
278 | # endif /* __LP64__ */␊ |
279 | #endif /* !__DARWIN_ONLY_UNIX_CONFORMANCE */␊ |
280 | ␊ |
281 | #if !defined(__DARWIN_UNIX03)␊ |
282 | # if __DARWIN_ONLY_UNIX_CONFORMANCE␊ |
283 | # if defined(_NONSTD_SOURCE)␊ |
284 | # error "Can't define _NONSTD_SOURCE when only UNIX conformance is available."␊ |
285 | # endif /* _NONSTD_SOURCE */␊ |
286 | # define __DARWIN_UNIX03␉1␊ |
287 | # elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1040)␊ |
288 | # define __DARWIN_UNIX03␉0␊ |
289 | # elif defined(_DARWIN_C_SOURCE) || defined(_XOPEN_SOURCE) || defined(_POSIX_C_SOURCE)␊ |
290 | # if defined(_NONSTD_SOURCE)␊ |
291 | # error "Can't define both _NONSTD_SOURCE and any of _DARWIN_C_SOURCE, _XOPEN_SOURCE or _POSIX_C_SOURCE."␊ |
292 | # endif /* _NONSTD_SOURCE */␊ |
293 | # define __DARWIN_UNIX03␉1␊ |
294 | # elif defined(_NONSTD_SOURCE)␊ |
295 | # define __DARWIN_UNIX03␉0␊ |
296 | # else /* default */␊ |
297 | # if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050)␊ |
298 | # define __DARWIN_UNIX03␉0␊ |
299 | # else /* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 */␊ |
300 | # define __DARWIN_UNIX03␉1␊ |
301 | # endif /* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 */␊ |
302 | # endif /* _DARWIN_C_SOURCE || _XOPEN_SOURCE || _POSIX_C_SOURCE || __LP64__ */␊ |
303 | #endif /* !__DARWIN_UNIX03 */␊ |
304 | ␊ |
305 | #if !defined(__DARWIN_64_BIT_INO_T)␊ |
306 | # if defined(_DARWIN_USE_64_BIT_INODE)␊ |
307 | # if defined(_DARWIN_NO_64_BIT_INODE)␊ |
308 | # error "Can't define both _DARWIN_USE_64_BIT_INODE and _DARWIN_NO_64_BIT_INODE."␊ |
309 | # endif /* _DARWIN_NO_64_BIT_INODE */␊ |
310 | # define __DARWIN_64_BIT_INO_T 1␊ |
311 | # elif defined(_DARWIN_NO_64_BIT_INODE)␊ |
312 | # if __DARWIN_ONLY_64_BIT_INO_T␊ |
313 | # error "Can't define _DARWIN_NO_64_BIT_INODE when only 64-bit inodes are available."␊ |
314 | # endif /* __DARWIN_ONLY_64_BIT_INO_T */␊ |
315 | # define __DARWIN_64_BIT_INO_T 0␊ |
316 | # else /* default */␊ |
317 | # if __DARWIN_ONLY_64_BIT_INO_T␊ |
318 | # define __DARWIN_64_BIT_INO_T 1␊ |
319 | # elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1060) || __DARWIN_UNIX03 == 0␊ |
320 | # define __DARWIN_64_BIT_INO_T 0␊ |
321 | # else /* default */␊ |
322 | # define __DARWIN_64_BIT_INO_T 1␊ |
323 | # endif /* __DARWIN_ONLY_64_BIT_INO_T */␊ |
324 | # endif␊ |
325 | #endif /* !__DARWIN_64_BIT_INO_T */␊ |
326 | ␊ |
327 | #if !defined(__DARWIN_VERS_1050)␊ |
328 | # if __DARWIN_ONLY_VERS_1050␊ |
329 | # define __DARWIN_VERS_1050 1␊ |
330 | # elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050) || __DARWIN_UNIX03 == 0␊ |
331 | # define __DARWIN_VERS_1050 0␊ |
332 | # else /* default */␊ |
333 | # define __DARWIN_VERS_1050 1␊ |
334 | # endif␊ |
335 | #endif /* !__DARWIN_VERS_1050 */␊ |
336 | ␊ |
337 | #if !defined(__DARWIN_NON_CANCELABLE)␊ |
338 | # define __DARWIN_NON_CANCELABLE 0␊ |
339 | #endif /* !__DARWIN_NON_CANCELABLE */␊ |
340 | ␊ |
341 | /*␊ |
342 | * symbol suffixes used for symbol versioning␊ |
343 | */␊ |
344 | #if __DARWIN_UNIX03␊ |
345 | # if __DARWIN_ONLY_UNIX_CONFORMANCE␊ |
346 | # define __DARWIN_SUF_UNIX03␉␉/* nothing */␊ |
347 | # else /* !__DARWIN_ONLY_UNIX_CONFORMANCE */␊ |
348 | # define __DARWIN_SUF_UNIX03␉␉"$UNIX2003"␊ |
349 | # endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */␊ |
350 | ␊ |
351 | # if __DARWIN_64_BIT_INO_T␊ |
352 | # if __DARWIN_ONLY_64_BIT_INO_T␊ |
353 | # define __DARWIN_SUF_64_BIT_INO_T␉/* nothing */␊ |
354 | # else /* !__DARWIN_ONLY_64_BIT_INO_T */␊ |
355 | # define __DARWIN_SUF_64_BIT_INO_T␉"$INODE64"␊ |
356 | # endif /* __DARWIN_ONLY_64_BIT_INO_T */␊ |
357 | # else /* !__DARWIN_64_BIT_INO_T */␊ |
358 | # define __DARWIN_SUF_64_BIT_INO_T␉/* nothing */␊ |
359 | # endif /* __DARWIN_64_BIT_INO_T */␊ |
360 | ␊ |
361 | # if __DARWIN_VERS_1050␊ |
362 | # if __DARWIN_ONLY_VERS_1050␊ |
363 | # define __DARWIN_SUF_1050␉␉/* nothing */␊ |
364 | # else /* !__DARWIN_ONLY_VERS_1050 */␊ |
365 | # define __DARWIN_SUF_1050␉␉"$1050"␊ |
366 | # endif /* __DARWIN_ONLY_VERS_1050 */␊ |
367 | # else /* !__DARWIN_VERS_1050 */␊ |
368 | # define __DARWIN_SUF_1050␉␉/* nothing */␊ |
369 | # endif /* __DARWIN_VERS_1050 */␊ |
370 | ␊ |
371 | # if __DARWIN_NON_CANCELABLE␊ |
372 | # define __DARWIN_SUF_NON_CANCELABLE␉"$NOCANCEL"␊ |
373 | # else /* !__DARWIN_NON_CANCELABLE */␊ |
374 | # define __DARWIN_SUF_NON_CANCELABLE␉/* nothing */␊ |
375 | # endif /* __DARWIN_NON_CANCELABLE */␊ |
376 | ␊ |
377 | #else /* !__DARWIN_UNIX03 */␊ |
378 | # define __DARWIN_SUF_UNIX03␉␉/* nothing */␊ |
379 | # define __DARWIN_SUF_64_BIT_INO_T␉/* nothing */␊ |
380 | # define __DARWIN_SUF_NON_CANCELABLE␉/* nothing */␊ |
381 | # define __DARWIN_SUF_1050␉␉/* nothing */␊ |
382 | #endif /* __DARWIN_UNIX03 */␊ |
383 | ␊ |
384 | #define __DARWIN_SUF_EXTSN␉␉"$DARWIN_EXTSN"␊ |
385 | ␊ |
386 | /*␊ |
387 | * symbol versioning macros␊ |
388 | */␊ |
389 | #define __DARWIN_ALIAS(sym)␉␉__asm("_" __STRING(sym) __DARWIN_SUF_UNIX03)␊ |
390 | #define __DARWIN_ALIAS_C(sym)␉␉__asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03)␊ |
391 | #define __DARWIN_ALIAS_I(sym)␉␉__asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03)␊ |
392 | #define __DARWIN_INODE64(sym)␉␉__asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T)␊ |
393 | ␊ |
394 | #define __DARWIN_1050(sym)␉␉__asm("_" __STRING(sym) __DARWIN_SUF_1050)␊ |
395 | #define __DARWIN_1050ALIAS(sym)␉␉__asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_UNIX03)␊ |
396 | #define __DARWIN_1050ALIAS_C(sym)␉__asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03)␊ |
397 | #define __DARWIN_1050ALIAS_I(sym)␉__asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03)␊ |
398 | #define __DARWIN_1050INODE64(sym)␉__asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T)␊ |
399 | ␊ |
400 | #define __DARWIN_EXTSN(sym)␉␉__asm("_" __STRING(sym) __DARWIN_SUF_EXTSN)␊ |
401 | #define __DARWIN_EXTSN_C(sym)␉␉__asm("_" __STRING(sym) __DARWIN_SUF_EXTSN __DARWIN_SUF_NON_CANCELABLE)␊ |
402 | ␊ |
403 | /*␊ |
404 | * symbol release macros␊ |
405 | */␊ |
406 | #include <sys/_symbol_aliasing.h>␊ |
407 | ␊ |
408 | #if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)␊ |
409 | #define __DARWIN_ALIAS_STARTING(_mac, _iphone, x) __DARWIN_ALIAS_STARTING_IPHONE_##_iphone(x)␊ |
410 | #elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)␊ |
411 | #define __DARWIN_ALIAS_STARTING(_mac, _iphone, x) __DARWIN_ALIAS_STARTING_MAC_##_mac(x)␊ |
412 | #else␊ |
413 | #define __DARWIN_ALIAS_STARTING(_mac, _iphone, x)␊ |
414 | #endif␊ |
415 | ␊ |
416 | ␊ |
417 | /*␊ |
418 | * POSIX.1 requires that the macros we test be defined before any standard␊ |
419 | * header file is included. This permits us to convert values for feature␊ |
420 | * testing, as necessary, using only _POSIX_C_SOURCE.␊ |
421 | *␊ |
422 | * Here's a quick run-down of the versions:␊ |
423 | * defined(_POSIX_SOURCE)␉␉1003.1-1988␊ |
424 | * _POSIX_C_SOURCE == 1L␉␉1003.1-1990␊ |
425 | * _POSIX_C_SOURCE == 2L␉␉1003.2-1992 C Language Binding Option␊ |
426 | * _POSIX_C_SOURCE == 199309L␉␉1003.1b-1993␊ |
427 | * _POSIX_C_SOURCE == 199506L␉␉1003.1c-1995, 1003.1i-1995,␊ |
428 | *␉␉␉␉␉and the omnibus ISO/IEC 9945-1: 1996␊ |
429 | * _POSIX_C_SOURCE == 200112L␉␉1003.1-2001␊ |
430 | * _POSIX_C_SOURCE == 200809L␉␉1003.1-2008␊ |
431 | *␊ |
432 | * In addition, the X/Open Portability Guide, which is now the Single UNIX␊ |
433 | * Specification, defines a feature-test macro which indicates the version of␊ |
434 | * that specification, and which subsumes _POSIX_C_SOURCE.␊ |
435 | */␊ |
436 | ␊ |
437 | /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1L. */␊ |
438 | #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1L␊ |
439 | #undef _POSIX_C_SOURCE␊ |
440 | #define␉_POSIX_C_SOURCE␉␉199009L␊ |
441 | #endif␊ |
442 | ␊ |
443 | /* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2L. */␊ |
444 | #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2L␊ |
445 | #undef _POSIX_C_SOURCE␊ |
446 | #define␉_POSIX_C_SOURCE␉␉199209L␊ |
447 | #endif␊ |
448 | ␊ |
449 | /* Deal with various X/Open Portability Guides and Single UNIX Spec. */␊ |
450 | #ifdef _XOPEN_SOURCE␊ |
451 | #if _XOPEN_SOURCE - 0L >= 700L && (!defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE - 0L < 200809L)␊ |
452 | #undef _POSIX_C_SOURCE␊ |
453 | #define _POSIX_C_SOURCE 200809L␊ |
454 | #elif _XOPEN_SOURCE - 0L >= 600L && (!defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE - 0L < 200112L)␊ |
455 | #undef _POSIX_C_SOURCE␊ |
456 | #define␉_POSIX_C_SOURCE␉␉200112L␊ |
457 | #elif _XOPEN_SOURCE - 0L >= 500L && (!defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE - 0L < 199506L)␊ |
458 | #undef _POSIX_C_SOURCE␊ |
459 | #define␉_POSIX_C_SOURCE␉␉199506L␊ |
460 | #endif␊ |
461 | #endif␊ |
462 | ␊ |
463 | /*␊ |
464 | * Deal with all versions of POSIX. The ordering relative to the tests above is␊ |
465 | * important.␊ |
466 | */␊ |
467 | #if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)␊ |
468 | #define _POSIX_C_SOURCE 198808L␊ |
469 | #endif␊ |
470 | ␊ |
471 | /* POSIX C deprecation macros */␊ |
472 | #include <sys/_posix_availability.h>␊ |
473 | ␊ |
474 | #define __POSIX_C_DEPRECATED(ver) ___POSIX_C_DEPRECATED_STARTING_##ver␊ |
475 | ␊ |
476 | /*␊ |
477 | * Set a single macro which will always be defined and can be used to determine␊ |
478 | * the appropriate namespace. For POSIX, these values will correspond to␊ |
479 | * _POSIX_C_SOURCE value. Currently there are two additional levels corresponding␊ |
480 | * to ANSI (_ANSI_SOURCE) and Darwin extensions (_DARWIN_C_SOURCE)␊ |
481 | */␊ |
482 | #define __DARWIN_C_ANSI 010000L␊ |
483 | #define __DARWIN_C_FULL 900000L␊ |
484 | ␊ |
485 | #if defined(_ANSI_SOURCE)␊ |
486 | #define __DARWIN_C_LEVEL __DARWIN_C_ANSI␊ |
487 | #elif defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE) && !defined(_NONSTD_SOURCE)␊ |
488 | #define __DARWIN_C_LEVEL _POSIX_C_SOURCE␊ |
489 | #else␊ |
490 | #define __DARWIN_C_LEVEL __DARWIN_C_FULL␊ |
491 | #endif␊ |
492 | ␊ |
493 | ␊ |
494 | /*␊ |
495 | * long long is not supported in c89 (__STRICT_ANSI__), but g++ -ansi and␊ |
496 | * c99 still want long longs. While not perfect, we allow long longs for␊ |
497 | * g++.␊ |
498 | */␊ |
499 | #define␉__DARWIN_NO_LONG_LONG␉(defined(__STRICT_ANSI__) \␊ |
500 | ␉␉␉␉&& (__STDC_VERSION__-0 < 199901L) \␊ |
501 | ␉␉␉␉&& !defined(__GNUG__))␊ |
502 | ␊ |
503 | /*****************************************␊ |
504 | * Public darwin-specific feature macros␊ |
505 | *****************************************/␊ |
506 | ␊ |
507 | /*␊ |
508 | * _DARWIN_FEATURE_64_BIT_INODE indicates that the ino_t type is 64-bit, and␊ |
509 | * structures modified for 64-bit inodes (like struct stat) will be used.␊ |
510 | */␊ |
511 | #if __DARWIN_64_BIT_INO_T␊ |
512 | #define _DARWIN_FEATURE_64_BIT_INODE␉␉1␊ |
513 | #endif␊ |
514 | ␊ |
515 | /*␊ |
516 | * _DARWIN_FEATURE_64_ONLY_BIT_INODE indicates that the ino_t type may only␊ |
517 | * be 64-bit; there is no support for 32-bit ino_t when this macro is defined␊ |
518 | * (and non-zero). There is no struct stat64 either, as the regular␊ |
519 | * struct stat will already be the 64-bit version.␊ |
520 | */␊ |
521 | #if __DARWIN_ONLY_64_BIT_INO_T␊ |
522 | #define _DARWIN_FEATURE_ONLY_64_BIT_INODE␉1␊ |
523 | #endif␊ |
524 | ␊ |
525 | /*␊ |
526 | * _DARWIN_FEATURE_ONLY_VERS_1050 indicates that only those APIs updated␊ |
527 | * in 10.5 exists; no pre-10.5 variants are available.␊ |
528 | */␊ |
529 | #if __DARWIN_ONLY_VERS_1050␊ |
530 | #define _DARWIN_FEATURE_ONLY_VERS_1050␉␉1␊ |
531 | #endif␊ |
532 | ␊ |
533 | /*␊ |
534 | * _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE indicates only UNIX conforming API␊ |
535 | * are available (the legacy BSD APIs are not available)␊ |
536 | */␊ |
537 | #if __DARWIN_ONLY_UNIX_CONFORMANCE␊ |
538 | #define _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE␉1␊ |
539 | #endif␊ |
540 | ␊ |
541 | /*␊ |
542 | * _DARWIN_FEATURE_UNIX_CONFORMANCE indicates whether UNIX conformance is on,␊ |
543 | * and specifies the conformance level (3 is SUSv3)␊ |
544 | */␊ |
545 | #if __DARWIN_UNIX03␊ |
546 | #define _DARWIN_FEATURE_UNIX_CONFORMANCE␉3␊ |
547 | #endif␊ |
548 | ␊ |
549 | /* ␊ |
550 | * This macro casts away the qualifier from the variable␊ |
551 | *␊ |
552 | * Note: use at your own risk, removing qualifiers can result in␊ |
553 | * catastrophic run-time failures.␊ |
554 | */␊ |
555 | #ifndef __CAST_AWAY_QUALIFIER␊ |
556 | #define __CAST_AWAY_QUALIFIER(variable, qualifier, type) (type) (long)(variable)␊ |
557 | #endif␊ |
558 | ␊ |
559 | #endif /* !_CDEFS_H_ */␊ |
560 | |