authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-08 19:15:08-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-08 20:21:29-08:00
logfdd775b3bf44a2095ad25defd78040f008733b28
treee782578d4452eab5bb8f5bb88a5ea540291cbca0
parenteed5814d7594e64b08b9a51697f2766df5fcb5f0

macOS libc headers: add xlocale.h and Block.h

These are both included by libcxx.

16 files changed, 1747 insertions(+), 0 deletions(-)

lib/libc/include/x86_64-macos-gnu/Block.h created+64
......@@ -0,0 +1,64 @@
1/*
2 * Block.h
3 *
4 * Copyright (c) 2008-2010 Apple Inc. All rights reserved.
5 *
6 * @APPLE_LLVM_LICENSE_HEADER@
7 *
8 */
9
10#ifndef _Block_H_
11#define _Block_H_
12
13#if !defined(BLOCK_EXPORT)
14# if defined(__cplusplus)
15# define BLOCK_EXPORT extern "C"
16# else
17# define BLOCK_EXPORT extern
18# endif
19#endif
20
21#include <Availability.h>
22#include <TargetConditionals.h>
23
24#if __cplusplus
25extern "C" {
26#endif
27
28// Create a heap based copy of a Block or simply add a reference to an existing one.
29// This must be paired with Block_release to recover memory, even when running
30// under Objective-C Garbage Collection.
31BLOCK_EXPORT void *_Block_copy(const void *aBlock)
32 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
33
34// Lose the reference, and if heap based and last reference, recover the memory
35BLOCK_EXPORT void _Block_release(const void *aBlock)
36 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
37
38
39// Used by the compiler. Do not call this function yourself.
40BLOCK_EXPORT void _Block_object_assign(void *, const void *, const int)
41 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
42
43// Used by the compiler. Do not call this function yourself.
44BLOCK_EXPORT void _Block_object_dispose(const void *, const int)
45 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
46
47// Used by the compiler. Do not use these variables yourself.
48BLOCK_EXPORT void * _NSConcreteGlobalBlock[32]
49 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
50BLOCK_EXPORT void * _NSConcreteStackBlock[32]
51 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
52
53
54#if __cplusplus
55}
56#endif
57
58// Type correct macros
59
60#define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__)))
61#define Block_release(...) _Block_release((const void *)(__VA_ARGS__))
62
63
64#endif
lib/libc/include/x86_64-macos-gnu/TargetConditionals.h created+502
......@@ -0,0 +1,502 @@
1/*
2 * Copyright (c) 2000-2014 by Apple Inc.. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24/*
25 File: TargetConditionals.h
26
27 Contains: Autoconfiguration of TARGET_ conditionals for Mac OS X and iPhone
28
29 Note: TargetConditionals.h in 3.4 Universal Interfaces works
30 with all compilers. This header only recognizes compilers
31 known to run on Mac OS X.
32
33*/
34
35#ifndef __TARGETCONDITIONALS__
36#define __TARGETCONDITIONALS__
37
38/****************************************************************************************************
39
40 TARGET_CPU_*
41 These conditionals specify which microprocessor instruction set is being
42 generated. At most one of these is true, the rest are false.
43
44 TARGET_CPU_PPC - Compiler is generating PowerPC instructions for 32-bit mode
45 TARGET_CPU_PPC64 - Compiler is generating PowerPC instructions for 64-bit mode
46 TARGET_CPU_68K - Compiler is generating 680x0 instructions
47 TARGET_CPU_X86 - Compiler is generating x86 instructions for 32-bit mode
48 TARGET_CPU_X86_64 - Compiler is generating x86 instructions for 64-bit mode
49 TARGET_CPU_ARM - Compiler is generating ARM instructions for 32-bit mode
50 TARGET_CPU_ARM64 - Compiler is generating ARM instructions for 64-bit mode
51 TARGET_CPU_MIPS - Compiler is generating MIPS instructions
52 TARGET_CPU_SPARC - Compiler is generating Sparc instructions
53 TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions
54
55
56 TARGET_OS_*
57 These conditionals specify in which Operating System the generated code will
58 run. Indention is used to show which conditionals are evolutionary subclasses.
59
60 The MAC/WIN32/UNIX conditionals are mutually exclusive.
61 The IOS/TV/WATCH conditionals are mutually exclusive.
62
63
64 TARGET_OS_WIN32 - Generated code will run under 32-bit Windows
65 TARGET_OS_UNIX - Generated code will run under some Unix (not OSX)
66 TARGET_OS_MAC - Generated code will run under Mac OS X variant
67 TARGET_OS_OSX - Generated code will run under OS X devices
68 TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator
69 TARGET_OS_IOS - Generated code will run under iOS
70 TARGET_OS_TV - Generated code will run under Apple TV OS
71 TARGET_OS_WATCH - Generated code will run under Apple Watch OS
72 TARGET_OS_BRIDGE - Generated code will run under Bridge devices
73 TARGET_OS_MACCATALYST - Generated code will run under macOS
74 TARGET_OS_SIMULATOR - Generated code will run under a simulator
75
76 TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead
77 TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR
78 TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH
79
80 +----------------------------------------------------------------+
81 | TARGET_OS_MAC |
82 | +---+ +-----------------------------------------------------+ |
83 | | | | TARGET_OS_IPHONE | |
84 | |OSX| | +-----+ +----+ +-------+ +--------+ +-------------+ | |
85 | | | | | IOS | | TV | | WATCH | | BRIDGE | | MACCATALYST | | |
86 | | | | +-----+ +----+ +-------+ +--------+ +-------------+ | |
87 | +---+ +-----------------------------------------------------+ |
88 +----------------------------------------------------------------+
89
90 TARGET_RT_*
91 These conditionals specify in which runtime the generated code will
92 run. This is needed when the OS and CPU support more than one runtime
93 (e.g. Mac OS X supports CFM and mach-o).
94
95 TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers
96 TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers
97 TARGET_RT_64_BIT - Generated code uses 64-bit pointers
98 TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used
99 TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used
100
101
102****************************************************************************************************/
103
104 /*
105 * TARGET_OS conditionals can be enabled via clang preprocessor extensions:
106 *
107 * __is_target_arch
108 * __is_target_vendor
109 * __is_target_os
110 * __is_target_environment
111 *
112 * “-target=x86_64-apple-ios12-macabi”
113 * TARGET_OS_MAC=1
114 * TARGET_OS_IPHONE=1
115 * TARGET_OS_IOS=1
116 * TARGET_OS_MACCATALYST=1
117 *
118 * “-target=x86_64-apple-ios12-simulator”
119 * TARGET_OS_MAC=1
120 * TARGET_OS_IPHONE=1
121 * TARGET_OS_IOS=1
122 * TARGET_OS_SIMULATOR=1
123 *
124 * DYNAMIC_TARGETS_ENABLED indicates that the core TARGET_OS macros were enabled via clang preprocessor extensions.
125 * If this value is not set, the macro enablements will fall back to the static behavior.
126 * It is disabled by default.
127 */
128
129#if defined(__has_builtin)
130 #if __has_builtin(__is_target_arch)
131 #if __has_builtin(__is_target_vendor)
132 #if __has_builtin(__is_target_os)
133 #if __has_builtin(__is_target_environment)
134
135 /* “-target=x86_64-apple-ios12-macabi” */
136 #if __is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi)
137 #define TARGET_OS_OSX 0
138 #define TARGET_OS_IPHONE 1
139 #define TARGET_OS_IOS 1
140 #define TARGET_OS_WATCH 0
141
142 #define TARGET_OS_TV 0
143 #define TARGET_OS_SIMULATOR 0
144 #define TARGET_OS_EMBEDDED 0
145 #define TARGET_OS_RTKIT 0
146 #define TARGET_OS_MACCATALYST 1
147 #define TARGET_OS_MACCATALYST 1
148 #ifndef TARGET_OS_UIKITFORMAC
149 #define TARGET_OS_UIKITFORMAC 1
150 #endif
151 #define TARGET_OS_DRIVERKIT 0
152 #define DYNAMIC_TARGETS_ENABLED 1
153 #endif
154
155 /* “-target=x86_64-apple-ios12-simulator” */
156 #if __is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(simulator)
157 #define TARGET_OS_OSX 0
158 #define TARGET_OS_IPHONE 1
159 #define TARGET_OS_IOS 1
160 #define TARGET_OS_WATCH 0
161
162 #define TARGET_OS_TV 0
163 #define TARGET_OS_SIMULATOR 1
164 #define TARGET_OS_EMBEDDED 0
165 #define TARGET_OS_RTKIT 0
166 #define TARGET_OS_MACCATALYST 0
167 #define TARGET_OS_MACCATALYST 0
168 #ifndef TARGET_OS_UIKITFORMAC
169 #define TARGET_OS_UIKITFORMAC 0
170 #endif
171 #define TARGET_OS_DRIVERKIT 0
172 #define DYNAMIC_TARGETS_ENABLED 1
173 #endif
174
175 /* -target=x86_64-apple-driverkit19.0 */
176 #if __is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(driverkit)
177 #define TARGET_OS_OSX 0
178 #define TARGET_OS_IPHONE 0
179 #define TARGET_OS_IOS 0
180 #define TARGET_OS_WATCH 0
181
182 #define TARGET_OS_TV 0
183 #define TARGET_OS_SIMULATOR 0
184 #define TARGET_OS_EMBEDDED 0
185 #define TARGET_OS_RTKIT 0
186 #define TARGET_OS_MACCATALYST 0
187 #define TARGET_OS_MACCATALYST 0
188 #ifndef TARGET_OS_UIKITFORMAC
189 #define TARGET_OS_UIKITFORMAC 0
190 #endif
191 #define TARGET_OS_DRIVERKIT 1
192 #define DYNAMIC_TARGETS_ENABLED 1
193 #endif
194
195 #endif /* #if __has_builtin(__is_target_environment) */
196 #endif /* #if __has_builtin(__is_target_os) */
197 #endif /* #if __has_builtin(__is_target_vendor) */
198 #endif /* #if __has_builtin(__is_target_arch) */
199#endif /* #if defined(__has_builtin) */
200
201
202#ifndef DYNAMIC_TARGETS_ENABLED
203 #define DYNAMIC_TARGETS_ENABLED 0
204#endif /* DYNAMIC_TARGETS_ENABLED */
205
206/*
207 * gcc based compiler used on Mac OS X
208 */
209#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
210 #define TARGET_OS_MAC 1
211 #define TARGET_OS_WIN32 0
212 #define TARGET_OS_UNIX 0
213
214 #if !DYNAMIC_TARGETS_ENABLED
215 #define TARGET_OS_OSX 1
216 #define TARGET_OS_IPHONE 0
217 #define TARGET_OS_IOS 0
218 #define TARGET_OS_WATCH 0
219
220 #define TARGET_OS_TV 0
221 #define TARGET_OS_MACCATALYST 0
222 #define TARGET_OS_MACCATALYST 0
223 #ifndef TARGET_OS_UIKITFORMAC
224 #define TARGET_OS_UIKITFORMAC 0
225 #endif
226 #define TARGET_OS_SIMULATOR 0
227 #define TARGET_OS_EMBEDDED 0
228 #define TARGET_OS_RTKIT 0
229 #define TARGET_OS_DRIVERKIT 0
230 #endif
231
232 #define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */
233 #define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */
234 #define TARGET_ABI_USES_IOS_VALUES (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST)
235 #if defined(__ppc__)
236 #define TARGET_CPU_PPC 1
237 #define TARGET_CPU_PPC64 0
238 #define TARGET_CPU_68K 0
239 #define TARGET_CPU_X86 0
240 #define TARGET_CPU_X86_64 0
241 #define TARGET_CPU_ARM 0
242 #define TARGET_CPU_ARM64 0
243 #define TARGET_CPU_MIPS 0
244 #define TARGET_CPU_SPARC 0
245 #define TARGET_CPU_ALPHA 0
246 #define TARGET_RT_LITTLE_ENDIAN 0
247 #define TARGET_RT_BIG_ENDIAN 1
248 #define TARGET_RT_64_BIT 0
249 #ifdef __MACOS_CLASSIC__
250 #define TARGET_RT_MAC_CFM 1
251 #define TARGET_RT_MAC_MACHO 0
252 #else
253 #define TARGET_RT_MAC_CFM 0
254 #define TARGET_RT_MAC_MACHO 1
255 #endif
256 #elif defined(__ppc64__)
257 #define TARGET_CPU_PPC 0
258 #define TARGET_CPU_PPC64 1
259 #define TARGET_CPU_68K 0
260 #define TARGET_CPU_X86 0
261 #define TARGET_CPU_X86_64 0
262 #define TARGET_CPU_ARM 0
263 #define TARGET_CPU_ARM64 0
264 #define TARGET_CPU_MIPS 0
265 #define TARGET_CPU_SPARC 0
266 #define TARGET_CPU_ALPHA 0
267 #define TARGET_RT_LITTLE_ENDIAN 0
268 #define TARGET_RT_BIG_ENDIAN 1
269 #define TARGET_RT_64_BIT 1
270 #define TARGET_RT_MAC_CFM 0
271 #define TARGET_RT_MAC_MACHO 1
272 #elif defined(__i386__)
273 #define TARGET_CPU_PPC 0
274 #define TARGET_CPU_PPC64 0
275 #define TARGET_CPU_68K 0
276 #define TARGET_CPU_X86 1
277 #define TARGET_CPU_X86_64 0
278 #define TARGET_CPU_ARM 0
279 #define TARGET_CPU_ARM64 0
280 #define TARGET_CPU_MIPS 0
281 #define TARGET_CPU_SPARC 0
282 #define TARGET_CPU_ALPHA 0
283 #define TARGET_RT_MAC_CFM 0
284 #define TARGET_RT_MAC_MACHO 1
285 #define TARGET_RT_LITTLE_ENDIAN 1
286 #define TARGET_RT_BIG_ENDIAN 0
287 #define TARGET_RT_64_BIT 0
288 #elif defined(__x86_64__)
289 #define TARGET_CPU_PPC 0
290 #define TARGET_CPU_PPC64 0
291 #define TARGET_CPU_68K 0
292 #define TARGET_CPU_X86 0
293 #define TARGET_CPU_X86_64 1
294 #define TARGET_CPU_ARM 0
295 #define TARGET_CPU_ARM64 0
296 #define TARGET_CPU_MIPS 0
297 #define TARGET_CPU_SPARC 0
298 #define TARGET_CPU_ALPHA 0
299 #define TARGET_RT_MAC_CFM 0
300 #define TARGET_RT_MAC_MACHO 1
301 #define TARGET_RT_LITTLE_ENDIAN 1
302 #define TARGET_RT_BIG_ENDIAN 0
303 #define TARGET_RT_64_BIT 1
304 #elif defined(__arm__)
305 #define TARGET_CPU_PPC 0
306 #define TARGET_CPU_PPC64 0
307 #define TARGET_CPU_68K 0
308 #define TARGET_CPU_X86 0
309 #define TARGET_CPU_X86_64 0
310 #define TARGET_CPU_ARM 1
311 #define TARGET_CPU_ARM64 0
312 #define TARGET_CPU_MIPS 0
313 #define TARGET_CPU_SPARC 0
314 #define TARGET_CPU_ALPHA 0
315 #define TARGET_RT_MAC_CFM 0
316 #define TARGET_RT_MAC_MACHO 1
317 #define TARGET_RT_LITTLE_ENDIAN 1
318 #define TARGET_RT_BIG_ENDIAN 0
319 #define TARGET_RT_64_BIT 0
320 #elif defined(__arm64__)
321 #define TARGET_CPU_PPC 0
322 #define TARGET_CPU_PPC64 0
323 #define TARGET_CPU_68K 0
324 #define TARGET_CPU_X86 0
325 #define TARGET_CPU_X86_64 0
326 #define TARGET_CPU_ARM 0
327 #define TARGET_CPU_ARM64 1
328 #define TARGET_CPU_MIPS 0
329 #define TARGET_CPU_SPARC 0
330 #define TARGET_CPU_ALPHA 0
331 #define TARGET_RT_MAC_CFM 0
332 #define TARGET_RT_MAC_MACHO 1
333 #define TARGET_RT_LITTLE_ENDIAN 1
334 #define TARGET_RT_BIG_ENDIAN 0
335 #if __LP64__
336 #define TARGET_RT_64_BIT 1
337 #else
338 #define TARGET_RT_64_BIT 0
339 #endif
340 #else
341 #error unrecognized GNU C compiler
342 #endif
343
344
345
346/*
347 * CodeWarrior compiler from Metrowerks/Motorola
348 */
349#elif defined(__MWERKS__)
350 #define TARGET_OS_MAC 1
351 #define TARGET_OS_WIN32 0
352 #define TARGET_OS_UNIX 0
353 #define TARGET_OS_EMBEDDED 0
354 #if defined(__POWERPC__)
355 #define TARGET_CPU_PPC 1
356 #define TARGET_CPU_PPC64 0
357 #define TARGET_CPU_68K 0
358 #define TARGET_CPU_X86 0
359 #define TARGET_CPU_MIPS 0
360 #define TARGET_CPU_SPARC 0
361 #define TARGET_CPU_ALPHA 0
362 #define TARGET_RT_LITTLE_ENDIAN 0
363 #define TARGET_RT_BIG_ENDIAN 1
364 #elif defined(__INTEL__)
365 #define TARGET_CPU_PPC 0
366 #define TARGET_CPU_PPC64 0
367 #define TARGET_CPU_68K 0
368 #define TARGET_CPU_X86 1
369 #define TARGET_CPU_MIPS 0
370 #define TARGET_CPU_SPARC 0
371 #define TARGET_CPU_ALPHA 0
372 #define TARGET_RT_LITTLE_ENDIAN 1
373 #define TARGET_RT_BIG_ENDIAN 0
374 #else
375 #error unknown Metrowerks CPU type
376 #endif
377 #define TARGET_RT_64_BIT 0
378 #ifdef __MACH__
379 #define TARGET_RT_MAC_CFM 0
380 #define TARGET_RT_MAC_MACHO 1
381 #else
382 #define TARGET_RT_MAC_CFM 1
383 #define TARGET_RT_MAC_MACHO 0
384 #endif
385
386/*
387 * unknown compiler
388 */
389#else
390 #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
391 #define TARGET_CPU_PPC64 0
392 #define TARGET_CPU_68K 0
393 #define TARGET_CPU_X86 0
394 #define TARGET_CPU_X86_64 0
395 #define TARGET_CPU_ARM 0
396 #define TARGET_CPU_ARM64 0
397 #define TARGET_CPU_MIPS 0
398 #define TARGET_CPU_SPARC 0
399 #define TARGET_CPU_ALPHA 0
400 #elif defined(TARGET_CPU_PPC64) && TARGET_CPU_PPC64
401 #define TARGET_CPU_PPC 0
402 #define TARGET_CPU_68K 0
403 #define TARGET_CPU_X86 0
404 #define TARGET_CPU_X86_64 0
405 #define TARGET_CPU_ARM 0
406 #define TARGET_CPU_ARM64 0
407 #define TARGET_CPU_MIPS 0
408 #define TARGET_CPU_SPARC 0
409 #define TARGET_CPU_ALPHA 0
410 #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
411 #define TARGET_CPU_PPC 0
412 #define TARGET_CPU_PPC64 0
413 #define TARGET_CPU_X86_64 0
414 #define TARGET_CPU_68K 0
415 #define TARGET_CPU_ARM 0
416 #define TARGET_CPU_ARM64 0
417 #define TARGET_CPU_MIPS 0
418 #define TARGET_CPU_SPARC 0
419 #define TARGET_CPU_ALPHA 0
420 #elif defined(TARGET_CPU_X86_64) && TARGET_CPU_X86_64
421 #define TARGET_CPU_PPC 0
422 #define TARGET_CPU_PPC64 0
423 #define TARGET_CPU_X86 0
424 #define TARGET_CPU_68K 0
425 #define TARGET_CPU_ARM 0
426 #define TARGET_CPU_ARM64 0
427 #define TARGET_CPU_MIPS 0
428 #define TARGET_CPU_SPARC 0
429 #define TARGET_CPU_ALPHA 0
430 #elif defined(TARGET_CPU_ARM) && TARGET_CPU_ARM
431 #define TARGET_CPU_PPC 0
432 #define TARGET_CPU_PPC64 0
433 #define TARGET_CPU_X86 0
434 #define TARGET_CPU_X86_64 0
435 #define TARGET_CPU_68K 0
436 #define TARGET_CPU_ARM64 0
437 #define TARGET_CPU_MIPS 0
438 #define TARGET_CPU_SPARC 0
439 #define TARGET_CPU_ALPHA 0
440 #elif defined(TARGET_CPU_ARM64) && TARGET_CPU_ARM64
441 #define TARGET_CPU_PPC 0
442 #define TARGET_CPU_PPC64 0
443 #define TARGET_CPU_X86 0
444 #define TARGET_CPU_X86_64 0
445 #define TARGET_CPU_68K 0
446 #define TARGET_CPU_ARM 0
447 #define TARGET_CPU_MIPS 0
448 #define TARGET_CPU_SPARC 0
449 #define TARGET_CPU_ALPHA 0
450 #else
451 /*
452 NOTE: If your compiler errors out here then support for your compiler
453 has not yet been added to TargetConditionals.h.
454
455 TargetConditionals.h is designed to be plug-and-play. It auto detects
456 which compiler is being run and configures the TARGET_ conditionals
457 appropriately.
458
459 The short term work around is to set the TARGET_CPU_ and TARGET_OS_
460 on the command line to the compiler (e.g. -DTARGET_CPU_MIPS=1 -DTARGET_OS_UNIX=1)
461
462 The long term solution is to add a new case to this file which
463 auto detects your compiler and sets up the TARGET_ conditionals.
464 Then submit the changes to Apple Computer.
465 */
466 #error TargetConditionals.h: unknown compiler (see comment above)
467 #define TARGET_CPU_PPC 0
468 #define TARGET_CPU_68K 0
469 #define TARGET_CPU_X86 0
470 #define TARGET_CPU_ARM 0
471 #define TARGET_CPU_ARM64 0
472 #define TARGET_CPU_MIPS 0
473 #define TARGET_CPU_SPARC 0
474 #define TARGET_CPU_ALPHA 0
475 #endif
476 #define TARGET_OS_MAC 1
477 #define TARGET_OS_WIN32 0
478 #define TARGET_OS_UNIX 0
479 #define TARGET_OS_EMBEDDED 0
480 #if TARGET_CPU_PPC || TARGET_CPU_PPC64
481 #define TARGET_RT_BIG_ENDIAN 1
482 #define TARGET_RT_LITTLE_ENDIAN 0
483 #else
484 #define TARGET_RT_BIG_ENDIAN 0
485 #define TARGET_RT_LITTLE_ENDIAN 1
486 #endif
487 #if TARGET_CPU_PPC64 || TARGET_CPU_X86_64
488 #define TARGET_RT_64_BIT 1
489 #else
490 #define TARGET_RT_64_BIT 0
491 #endif
492 #ifdef __MACH__
493 #define TARGET_RT_MAC_MACHO 1
494 #define TARGET_RT_MAC_CFM 0
495 #else
496 #define TARGET_RT_MAC_MACHO 0
497 #define TARGET_RT_MAC_CFM 1
498 #endif
499
500#endif
501
502#endif /* __TARGETCONDITIONALS__ */
lib/libc/include/x86_64-macos-gnu/_xlocale.h created+37
......@@ -0,0 +1,37 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef __XLOCALE_H_
25#define __XLOCALE_H_
26
27#include <sys/cdefs.h>
28
29struct _xlocale; /* forward reference */
30typedef struct _xlocale * locale_t;
31
32__BEGIN_DECLS
33int ___mb_cur_max(void);
34int ___mb_cur_max_l(locale_t);
35__END_DECLS
36
37#endif /* __XLOCALE_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale.h created+111
......@@ -0,0 +1,111 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE_H_
25#define _XLOCALE_H_
26
27#include <sys/cdefs.h>
28
29#ifndef _USE_EXTENDED_LOCALES_
30#define _USE_EXTENDED_LOCALES_
31#endif /* _USE_EXTENDED_LOCALES_ */
32
33#include <_locale.h>
34#include <_xlocale.h>
35
36#define LC_ALL_MASK ( LC_COLLATE_MASK \
37 | LC_CTYPE_MASK \
38 | LC_MESSAGES_MASK \
39 | LC_MONETARY_MASK \
40 | LC_NUMERIC_MASK \
41 | LC_TIME_MASK )
42#define LC_COLLATE_MASK (1 << 0)
43#define LC_CTYPE_MASK (1 << 1)
44#define LC_MESSAGES_MASK (1 << 2)
45#define LC_MONETARY_MASK (1 << 3)
46#define LC_NUMERIC_MASK (1 << 4)
47#define LC_TIME_MASK (1 << 5)
48
49#define _LC_NUM_MASK 6
50#define _LC_LAST_MASK (1 << (_LC_NUM_MASK - 1))
51
52#define LC_GLOBAL_LOCALE ((locale_t)-1)
53#define LC_C_LOCALE ((locale_t)NULL)
54
55#ifdef MB_CUR_MAX
56#undef MB_CUR_MAX
57#define MB_CUR_MAX (___mb_cur_max())
58#ifndef MB_CUR_MAX_L
59#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
60#endif /* !MB_CUR_MAX_L */
61#endif /* MB_CUR_MAX */
62
63__BEGIN_DECLS
64extern const locale_t _c_locale;
65
66locale_t duplocale(locale_t);
67int freelocale(locale_t);
68struct lconv * localeconv_l(locale_t);
69locale_t newlocale(int, __const char *, locale_t);
70__const char * querylocale(int, locale_t);
71locale_t uselocale(locale_t);
72__END_DECLS
73
74#ifdef _CTYPE_H_
75#include <xlocale/_ctype.h>
76#endif /* _CTYPE_H_ */
77#ifdef __WCTYPE_H_
78#include <xlocale/__wctype.h>
79#endif /* __WCTYPE_H_ */
80#ifdef _INTTYPES_H_
81#include <xlocale/_inttypes.h>
82#endif /* _INTTYPES_H_ */
83#ifdef _LANGINFO_H_
84#include <xlocale/_langinfo.h>
85#endif /* _LANGINFO_H_ */
86#ifdef _MONETARY_H_
87#include <xlocale/_monetary.h>
88#endif /* _MONETARY_H_ */
89#ifdef _REGEX_H_
90#include <xlocale/_regex.h>
91#endif /* _REGEX_H_ */
92#ifdef _STDIO_H_
93#include <xlocale/_stdio.h>
94#endif /* _STDIO_H_ */
95#ifdef _STDLIB_H_
96#include <xlocale/_stdlib.h>
97#endif /* _STDLIB_H_ */
98#ifdef _STRING_H_
99#include <xlocale/_string.h>
100#endif /*STRING_CTYPE_H_ */
101#ifdef _TIME_H_
102#include <xlocale/_time.h>
103#endif /* _TIME_H_ */
104#ifdef _WCHAR_H_
105#include <xlocale/_wchar.h>
106#endif /*WCHAR_CTYPE_H_ */
107#ifdef _WCTYPE_H_
108#include <xlocale/_wctype.h>
109#endif /* _WCTYPE_H_ */
110
111#endif /* _XLOCALE_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/__wctype.h created+143
......@@ -0,0 +1,143 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE___WCTYPE_H_
25#define _XLOCALE___WCTYPE_H_
26
27#include <__wctype.h>
28#include <xlocale/_ctype.h>
29
30#if !defined(_DONT_USE_CTYPE_INLINE_) && \
31 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
32
33__DARWIN_WCTYPE_TOP_inline int
34iswalnum_l(wint_t _wc, locale_t _l)
35{
36 return (__istype_l(_wc, _CTYPE_A|_CTYPE_D, _l));
37}
38
39__DARWIN_WCTYPE_TOP_inline int
40iswalpha_l(wint_t _wc, locale_t _l)
41{
42 return (__istype_l(_wc, _CTYPE_A, _l));
43}
44
45__DARWIN_WCTYPE_TOP_inline int
46iswcntrl_l(wint_t _wc, locale_t _l)
47{
48 return (__istype_l(_wc, _CTYPE_C, _l));
49}
50
51__DARWIN_WCTYPE_TOP_inline int
52iswctype_l(wint_t _wc, wctype_t _charclass, locale_t _l)
53{
54 return (__istype_l(_wc, _charclass, _l));
55}
56
57__DARWIN_WCTYPE_TOP_inline int
58iswdigit_l(wint_t _wc, locale_t _l)
59{
60 return (__istype_l(_wc, _CTYPE_D, _l));
61}
62
63__DARWIN_WCTYPE_TOP_inline int
64iswgraph_l(wint_t _wc, locale_t _l)
65{
66 return (__istype_l(_wc, _CTYPE_G, _l));
67}
68
69__DARWIN_WCTYPE_TOP_inline int
70iswlower_l(wint_t _wc, locale_t _l)
71{
72 return (__istype_l(_wc, _CTYPE_L, _l));
73}
74
75__DARWIN_WCTYPE_TOP_inline int
76iswprint_l(wint_t _wc, locale_t _l)
77{
78 return (__istype_l(_wc, _CTYPE_R, _l));
79}
80
81__DARWIN_WCTYPE_TOP_inline int
82iswpunct_l(wint_t _wc, locale_t _l)
83{
84 return (__istype_l(_wc, _CTYPE_P, _l));
85}
86
87__DARWIN_WCTYPE_TOP_inline int
88iswspace_l(wint_t _wc, locale_t _l)
89{
90 return (__istype_l(_wc, _CTYPE_S, _l));
91}
92
93__DARWIN_WCTYPE_TOP_inline int
94iswupper_l(wint_t _wc, locale_t _l)
95{
96 return (__istype_l(_wc, _CTYPE_U, _l));
97}
98
99__DARWIN_WCTYPE_TOP_inline int
100iswxdigit_l(wint_t _wc, locale_t _l)
101{
102 return (__istype_l(_wc, _CTYPE_X, _l));
103}
104
105__DARWIN_WCTYPE_TOP_inline wint_t
106towlower_l(wint_t _wc, locale_t _l)
107{
108 return (__tolower_l(_wc, _l));
109}
110
111__DARWIN_WCTYPE_TOP_inline wint_t
112towupper_l(wint_t _wc, locale_t _l)
113{
114 return (__toupper_l(_wc, _l));
115}
116
117#else /* not using inlines */
118
119__BEGIN_DECLS
120int iswalnum_l(wint_t, locale_t);
121int iswalpha_l(wint_t, locale_t);
122int iswcntrl_l(wint_t, locale_t);
123int iswctype_l(wint_t, wctype_t, locale_t);
124int iswdigit_l(wint_t, locale_t);
125int iswgraph_l(wint_t, locale_t);
126int iswlower_l(wint_t, locale_t);
127int iswprint_l(wint_t, locale_t);
128int iswpunct_l(wint_t, locale_t);
129int iswspace_l(wint_t, locale_t);
130int iswupper_l(wint_t, locale_t);
131int iswxdigit_l(wint_t, locale_t);
132wint_t towlower_l(wint_t, locale_t);
133wint_t towupper_l(wint_t, locale_t);
134__END_DECLS
135
136#endif /* using inlines */
137
138__BEGIN_DECLS
139wctype_t
140 wctype_l(const char *, locale_t);
141__END_DECLS
142
143#endif /* _XLOCALE___WCTYPE_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_ctype.h created+237
......@@ -0,0 +1,237 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__CTYPE_H_
25#define _XLOCALE__CTYPE_H_
26
27#include <_ctype.h>
28#include <_xlocale.h>
29
30/*
31 * Use inline functions if we are allowed to and the compiler supports them.
32 */
33#if !defined(_DONT_USE_CTYPE_INLINE_) && \
34 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
35
36/* See comments in <machine/_type.h> about __darwin_ct_rune_t. */
37__BEGIN_DECLS
38unsigned long ___runetype_l(__darwin_ct_rune_t, locale_t);
39__darwin_ct_rune_t ___tolower_l(__darwin_ct_rune_t, locale_t);
40__darwin_ct_rune_t ___toupper_l(__darwin_ct_rune_t, locale_t);
41__END_DECLS
42
43__BEGIN_DECLS
44int __maskrune_l(__darwin_ct_rune_t, unsigned long, locale_t);
45__END_DECLS
46
47__DARWIN_CTYPE_inline int
48__istype_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l)
49{
50 return !!(isascii(_c) ? (_DefaultRuneLocale.__runetype[_c] & _f)
51 : __maskrune_l(_c, _f, _l));
52}
53
54__DARWIN_CTYPE_inline __darwin_ct_rune_t
55__toupper_l(__darwin_ct_rune_t _c, locale_t _l)
56{
57 return isascii(_c) ? _DefaultRuneLocale.__mapupper[_c]
58 : ___toupper_l(_c, _l);
59}
60
61__DARWIN_CTYPE_inline __darwin_ct_rune_t
62__tolower_l(__darwin_ct_rune_t _c, locale_t _l)
63{
64 return isascii(_c) ? _DefaultRuneLocale.__maplower[_c]
65 : ___tolower_l(_c, _l);
66}
67
68__DARWIN_CTYPE_inline int
69__wcwidth_l(__darwin_ct_rune_t _c, locale_t _l)
70{
71 unsigned int _x;
72
73 if (_c == 0)
74 return (0);
75 _x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, _l);
76 if ((_x & _CTYPE_SWM) != 0)
77 return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
78 return ((_x & _CTYPE_R) != 0 ? 1 : -1);
79}
80
81#ifndef _EXTERNALIZE_CTYPE_INLINES_
82
83__DARWIN_CTYPE_TOP_inline int
84digittoint_l(int c, locale_t l)
85{
86 return (__maskrune_l(c, 0x0F, l));
87}
88
89__DARWIN_CTYPE_TOP_inline int
90isalnum_l(int c, locale_t l)
91{
92 return (__istype_l(c, _CTYPE_A|_CTYPE_D, l));
93}
94
95__DARWIN_CTYPE_TOP_inline int
96isalpha_l(int c, locale_t l)
97{
98 return (__istype_l(c, _CTYPE_A, l));
99}
100
101__DARWIN_CTYPE_TOP_inline int
102isblank_l(int c, locale_t l)
103{
104 return (__istype_l(c, _CTYPE_B, l));
105}
106
107__DARWIN_CTYPE_TOP_inline int
108iscntrl_l(int c, locale_t l)
109{
110 return (__istype_l(c, _CTYPE_C, l));
111}
112
113__DARWIN_CTYPE_TOP_inline int
114isdigit_l(int c, locale_t l)
115{
116 return (__istype_l(c, _CTYPE_D, l));
117}
118
119__DARWIN_CTYPE_TOP_inline int
120isgraph_l(int c, locale_t l)
121{
122 return (__istype_l(c, _CTYPE_G, l));
123}
124
125__DARWIN_CTYPE_TOP_inline int
126ishexnumber_l(int c, locale_t l)
127{
128 return (__istype_l(c, _CTYPE_X, l));
129}
130
131__DARWIN_CTYPE_TOP_inline int
132isideogram_l(int c, locale_t l)
133{
134 return (__istype_l(c, _CTYPE_I, l));
135}
136
137__DARWIN_CTYPE_TOP_inline int
138islower_l(int c, locale_t l)
139{
140 return (__istype_l(c, _CTYPE_L, l));
141}
142
143__DARWIN_CTYPE_TOP_inline int
144isnumber_l(int c, locale_t l)
145{
146 return (__istype_l(c, _CTYPE_D, l));
147}
148
149__DARWIN_CTYPE_TOP_inline int
150isphonogram_l(int c, locale_t l)
151{
152 return (__istype_l(c, _CTYPE_Q, l));
153}
154
155__DARWIN_CTYPE_TOP_inline int
156isprint_l(int c, locale_t l)
157{
158 return (__istype_l(c, _CTYPE_R, l));
159}
160
161__DARWIN_CTYPE_TOP_inline int
162ispunct_l(int c, locale_t l)
163{
164 return (__istype_l(c, _CTYPE_P, l));
165}
166
167__DARWIN_CTYPE_TOP_inline int
168isrune_l(int c, locale_t l)
169{
170 return (__istype_l(c, 0xFFFFFFF0L, l));
171}
172
173__DARWIN_CTYPE_TOP_inline int
174isspace_l(int c, locale_t l)
175{
176 return (__istype_l(c, _CTYPE_S, l));
177}
178
179__DARWIN_CTYPE_TOP_inline int
180isspecial_l(int c, locale_t l)
181{
182 return (__istype_l(c, _CTYPE_T, l));
183}
184
185__DARWIN_CTYPE_TOP_inline int
186isupper_l(int c, locale_t l)
187{
188 return (__istype_l(c, _CTYPE_U, l));
189}
190
191__DARWIN_CTYPE_TOP_inline int
192isxdigit_l(int c, locale_t l)
193{
194 return (__istype_l(c, _CTYPE_X, l));
195}
196
197__DARWIN_CTYPE_TOP_inline int
198tolower_l(int c, locale_t l)
199{
200 return (__tolower_l(c, l));
201}
202
203__DARWIN_CTYPE_TOP_inline int
204toupper_l(int c, locale_t l)
205{
206 return (__toupper_l(c, l));
207}
208#endif /* _EXTERNALIZE_CTYPE_INLINES_ */
209
210#else /* not using inlines */
211
212__BEGIN_DECLS
213int digittoint_l(int, locale_t);
214int isalnum_l(int, locale_t);
215int isalpha_l(int, locale_t);
216int isblank_l(int, locale_t);
217int iscntrl_l(int, locale_t);
218int isdigit_l(int, locale_t);
219int isgraph_l(int, locale_t);
220int ishexnumber_l(int, locale_t);
221int isideogram_l(int, locale_t);
222int islower_l(int, locale_t);
223int isnumber_l(int, locale_t);
224int isphonogram_l(int, locale_t);
225int isprint_l(int, locale_t);
226int ispunct_l(int, locale_t);
227int isrune_l(int, locale_t);
228int isspace_l(int, locale_t);
229int isspecial_l(int, locale_t);
230int isupper_l(int, locale_t);
231int isxdigit_l(int, locale_t);
232int tolower_l(int, locale_t);
233int toupper_l(int, locale_t);
234__END_DECLS
235#endif /* using inlines */
236
237#endif /* _XLOCALE__CTYPE_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_inttypes.h created+47
......@@ -0,0 +1,47 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__INTTYPES_H_
25#define _XLOCALE__INTTYPES_H_
26
27#include <sys/cdefs.h>
28#include <stdint.h>
29#include <_xlocale.h>
30
31__BEGIN_DECLS
32intmax_t strtoimax_l(const char * __restrict nptr, char ** __restrict endptr,
33 int base, locale_t);
34uintmax_t strtoumax_l(const char * __restrict nptr, char ** __restrict endptr,
35 int base, locale_t);
36intmax_t wcstoimax_l(const wchar_t * __restrict nptr,
37 wchar_t ** __restrict endptr, int base, locale_t);
38uintmax_t wcstoumax_l(const wchar_t * __restrict nptr,
39 wchar_t ** __restrict endptr, int base, locale_t);
40
41/* Poison the following routines if -fshort-wchar is set */
42#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
43#pragma GCC poison wcstoimax_l wcstoumax_l
44#endif
45__END_DECLS
46
47#endif /* _XLOCALE__INTTYPES_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_langinfo.h created+35
......@@ -0,0 +1,35 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__LANGINFO_H_
25#define _XLOCALE__LANGINFO_H_
26
27#include <sys/cdefs.h>
28#include <_types/_nl_item.h>
29#include <_xlocale.h>
30
31__BEGIN_DECLS
32char *nl_langinfo_l(nl_item, locale_t);
33__END_DECLS
34
35#endif /* _XLOCALE__LANGINFO_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_monetary.h created+38
......@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) 2005, 2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__MONETARY_H_
25#define _XLOCALE__MONETARY_H_
26
27#include <sys/cdefs.h>
28#include <_types.h>
29#include <sys/_types/_size_t.h>
30#include <sys/_types/_ssize_t.h>
31#include <_xlocale.h>
32
33__BEGIN_DECLS
34ssize_t strfmon_l(char *, size_t, locale_t, const char *, ...)
35 __strfmonlike(4, 5);
36__END_DECLS
37
38#endif /* _XLOCALE__MONETARY_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_regex.h created+55
......@@ -0,0 +1,55 @@
1/*
2 * Copyright (c) 2011 Apple Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__REGEX_H_
25#define _XLOCALE__REGEX_H_
26
27#ifndef _REGEX_H_
28#include <_regex.h>
29#endif // _REGEX_H_
30#include <_xlocale.h>
31
32__BEGIN_DECLS
33
34int regcomp_l(regex_t * __restrict, const char * __restrict, int,
35 locale_t __restrict)
36 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA);
37
38#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
39
40int regncomp_l(regex_t * __restrict, const char * __restrict, size_t,
41 int, locale_t __restrict)
42 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA);
43int regwcomp_l(regex_t * __restrict, const wchar_t * __restrict,
44 int, locale_t __restrict)
45 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA);
46int regwnexec_l(const regex_t * __restrict, const wchar_t * __restrict,
47 size_t, size_t, regmatch_t __pmatch[ __restrict], int,
48 locale_t __restrict)
49 __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA);
50
51#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
52
53__END_DECLS
54
55#endif /* _XLOCALE__REGEX_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_stdio.h created+82
......@@ -0,0 +1,82 @@
1/*
2 * Copyright (c) 2005, 2009, 2010 Apple Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__STDIO_H_
25#define _XLOCALE__STDIO_H_
26
27#include <_stdio.h>
28#include <_xlocale.h>
29
30__BEGIN_DECLS
31
32int fprintf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, ...)
33 __printflike(3, 4);
34int fscanf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, ...)
35 __scanflike(3, 4);
36int printf_l(locale_t __restrict, const char * __restrict, ...)
37 __printflike(2, 3);
38int scanf_l(locale_t __restrict, const char * __restrict, ...)
39 __scanflike(2, 3);
40int sprintf_l(char * __restrict, locale_t __restrict, const char * __restrict, ...)
41 __printflike(3, 4) __swift_unavailable("Use snprintf_l instead.");
42int sscanf_l(const char * __restrict, locale_t __restrict, const char * __restrict, ...)
43 __scanflike(3, 4);
44int vfprintf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, va_list)
45 __printflike(3, 0);
46int vprintf_l(locale_t __restrict, const char * __restrict, va_list)
47 __printflike(2, 0);
48int vsprintf_l(char * __restrict, locale_t __restrict, const char * __restrict, va_list)
49 __printflike(3, 0) __swift_unavailable("Use vsnprintf_l instead.");
50
51#if __DARWIN_C_LEVEL >= 200112L || defined(__cplusplus)
52int snprintf_l(char * __restrict, size_t, locale_t __restrict, const char * __restrict, ...)
53 __printflike(4, 5);
54int vfscanf_l(FILE * __restrict, locale_t __restrict, const char * __restrict, va_list)
55 __scanflike(3, 0);
56int vscanf_l(locale_t __restrict, const char * __restrict, va_list)
57 __scanflike(2, 0);
58int vsnprintf_l(char * __restrict, size_t, locale_t __restrict, const char * __restrict, va_list)
59 __printflike(4, 0);
60int vsscanf_l(const char * __restrict, locale_t __restrict, const char * __restrict, va_list)
61 __scanflike(3, 0);
62#endif
63
64#if __DARWIN_C_LEVEL >= 200809L || defined(__cplusplus)
65int dprintf_l(int, locale_t __restrict, const char * __restrict, ...)
66 __printflike(3, 4) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
67int vdprintf_l(int, locale_t __restrict, const char * __restrict, va_list)
68 __printflike(3, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
69#endif
70
71
72#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL || defined(__cplusplus)
73int asprintf_l(char ** __restrict, locale_t __restrict, const char * __restrict, ...)
74 __printflike(3, 4);
75int vasprintf_l(char ** __restrict, locale_t __restrict, const char * __restrict, va_list)
76 __printflike(3, 0);
77#endif
78
79__END_DECLS
80
81
82#endif /* _XLOCALE__STDIO_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_stdlib.h created+74
......@@ -0,0 +1,74 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__STDLIB_H_
25#define _XLOCALE__STDLIB_H_
26
27#include <sys/cdefs.h>
28#include <sys/_types/_size_t.h>
29#include <sys/_types/_wchar_t.h>
30#include <_xlocale.h>
31
32__BEGIN_DECLS
33double atof_l(const char *, locale_t);
34int atoi_l(const char *, locale_t);
35long atol_l(const char *, locale_t);
36#if !__DARWIN_NO_LONG_LONG
37long long
38 atoll_l(const char *, locale_t);
39#endif /* !__DARWIN_NO_LONG_LONG */
40int mblen_l(const char *, size_t, locale_t);
41size_t mbstowcs_l(wchar_t * __restrict , const char * __restrict, size_t,
42 locale_t);
43int mbtowc_l(wchar_t * __restrict, const char * __restrict, size_t,
44 locale_t);
45double strtod_l(const char *, char **, locale_t) __DARWIN_ALIAS(strtod_l);
46float strtof_l(const char *, char **, locale_t) __DARWIN_ALIAS(strtof_l);
47long strtol_l(const char *, char **, int, locale_t);
48long double
49 strtold_l(const char *, char **, locale_t);
50long long
51 strtoll_l(const char *, char **, int, locale_t);
52#if !__DARWIN_NO_LONG_LONG
53long long
54 strtoq_l(const char *, char **, int, locale_t);
55#endif /* !__DARWIN_NO_LONG_LONG */
56unsigned long
57 strtoul_l(const char *, char **, int, locale_t);
58unsigned long long
59 strtoull_l(const char *, char **, int, locale_t);
60#if !__DARWIN_NO_LONG_LONG
61unsigned long long
62 strtouq_l(const char *, char **, int, locale_t);
63#endif /* !__DARWIN_NO_LONG_LONG */
64size_t wcstombs_l(char * __restrict, const wchar_t * __restrict, size_t,
65 locale_t);
66int wctomb_l(char *, wchar_t, locale_t);
67
68/* Poison the following routines if -fshort-wchar is set */
69#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
70#pragma GCC poison mbstowcs_l mbtowc_l wcstombs_l wctomb_l
71#endif
72__END_DECLS
73
74#endif /* _XLOCALE__STDLIB_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_string.h created+39
......@@ -0,0 +1,39 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__STRING_H_
25#define _XLOCALE__STRING_H_
26
27#include <sys/cdefs.h>
28#include <sys/_types/_size_t.h>
29#include <_xlocale.h>
30
31__BEGIN_DECLS
32int strcoll_l(const char *, const char *, locale_t);
33size_t strxfrm_l(char *, const char *, size_t, locale_t);
34int strcasecmp_l(const char *, const char *, locale_t);
35char *strcasestr_l(const char *, const char *, locale_t);
36int strncasecmp_l(const char *, const char *, size_t, locale_t);
37__END_DECLS
38
39#endif /* _XLOCALE__STRING_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_time.h created+41
......@@ -0,0 +1,41 @@
1/*
2 * Copyright (c) 2005, 2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__TIME_H_
25#define _XLOCALE__TIME_H_
26
27#include <sys/cdefs.h>
28#include <sys/_types/_size_t.h>
29#include <_types.h>
30#include <_xlocale.h>
31
32__BEGIN_DECLS
33size_t strftime_l(char * __restrict, size_t, const char * __restrict,
34 const struct tm * __restrict, locale_t)
35 __DARWIN_ALIAS(strftime_l) __strftimelike(3);
36char *strptime_l(const char * __restrict, const char * __restrict,
37 struct tm * __restrict, locale_t)
38 __DARWIN_ALIAS(strptime_l) __strftimelike(2);
39__END_DECLS
40
41#endif /* _XLOCALE__TIME_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_wchar.h created+145
......@@ -0,0 +1,145 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__WCHAR_H_
25#define _XLOCALE__WCHAR_H_
26
27#include <_stdio.h>
28#include <_xlocale.h>
29#include <sys/_types/_mbstate_t.h>
30
31/* Initially added in Issue 4 */
32__BEGIN_DECLS
33wint_t btowc_l(int, locale_t);
34wint_t fgetwc_l(FILE *, locale_t);
35wchar_t *fgetws_l(wchar_t * __restrict, int, FILE * __restrict, locale_t);
36wint_t fputwc_l(wchar_t, FILE *, locale_t);
37int fputws_l(const wchar_t * __restrict, FILE * __restrict, locale_t);
38int fwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...);
39int fwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...);
40wint_t getwc_l(FILE *, locale_t);
41wint_t getwchar_l(locale_t);
42size_t mbrlen_l(const char * __restrict, size_t, mbstate_t * __restrict,
43 locale_t);
44size_t mbrtowc_l(wchar_t * __restrict, const char * __restrict, size_t,
45 mbstate_t * __restrict, locale_t);
46int mbsinit_l(const mbstate_t *, locale_t);
47size_t mbsrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t,
48 mbstate_t * __restrict, locale_t);
49wint_t putwc_l(wchar_t, FILE *, locale_t);
50wint_t putwchar_l(wchar_t, locale_t);
51int swprintf_l(wchar_t * __restrict, size_t n, locale_t,
52 const wchar_t * __restrict, ...);
53int swscanf_l(const wchar_t * __restrict, locale_t,
54 const wchar_t * __restrict, ...);
55wint_t ungetwc_l(wint_t, FILE *, locale_t);
56int vfwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict,
57 __darwin_va_list);
58int vswprintf_l(wchar_t * __restrict, size_t n, locale_t,
59 const wchar_t * __restrict, __darwin_va_list);
60int vwprintf_l(locale_t, const wchar_t * __restrict, __darwin_va_list);
61size_t wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict,
62 locale_t);
63int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
64size_t wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict,
65 const struct tm * __restrict, locale_t)
66 __DARWIN_ALIAS(wcsftime_l);
67size_t wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t,
68 mbstate_t * __restrict, locale_t);
69double wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t);
70long wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
71 locale_t);
72unsigned long
73 wcstoul_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
74 locale_t);
75int wcswidth_l(const wchar_t *, size_t, locale_t);
76size_t wcsxfrm_l(wchar_t * __restrict, const wchar_t * __restrict, size_t,
77 locale_t);
78int wctob_l(wint_t, locale_t);
79int wcwidth_l(wchar_t, locale_t);
80int wprintf_l(locale_t, const wchar_t * __restrict, ...);
81int wscanf_l(locale_t, const wchar_t * __restrict, ...);
82__END_DECLS
83
84
85
86/* Additional functionality provided by:
87 * POSIX.1-2001
88 */
89
90#if __DARWIN_C_LEVEL >= 200112L
91__BEGIN_DECLS
92int vfwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict,
93 __darwin_va_list);
94int vswscanf_l(const wchar_t * __restrict, locale_t,
95 const wchar_t * __restrict, __darwin_va_list);
96int vwscanf_l(locale_t, const wchar_t * __restrict, __darwin_va_list);
97float wcstof_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t);
98long double
99 wcstold_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t);
100#if !__DARWIN_NO_LONG_LONG
101long long
102 wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
103 locale_t);
104unsigned long long
105 wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
106 locale_t);
107#endif /* !__DARWIN_NO_LONG_LONG */
108__END_DECLS
109#endif /* __DARWIN_C_LEVEL >= 200112L */
110
111
112
113/* Additional functionality provided by:
114 * POSIX.1-2008
115 */
116
117#if __DARWIN_C_LEVEL >= 200809L
118__BEGIN_DECLS
119size_t mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t,
120 size_t, mbstate_t * __restrict, locale_t);
121int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
122int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t n, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
123size_t wcsnrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t,
124 size_t, mbstate_t * __restrict, locale_t);
125__END_DECLS
126#endif /* __DARWIN_C_LEVEL >= 200809L */
127
128
129
130/* Darwin extensions */
131
132#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
133__BEGIN_DECLS
134wchar_t *fgetwln_l(FILE * __restrict, size_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
135__END_DECLS
136#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
137
138
139
140/* Poison the following routines if -fshort-wchar is set */
141#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
142#pragma GCC poison fgetwln_l fgetws_l fputwc_l fputws_l fwprintf_l fwscanf_l mbrtowc_l mbsnrtowcs_l mbsrtowcs_l putwc_l putwchar_l swprintf_l swscanf_l vfwprintf_l vfwscanf_l vswprintf_l vswscanf_l vwprintf_l vwscanf_l wcrtomb_l wcscoll_l wcsftime_l wcsftime_l wcsnrtombs_l wcsrtombs_l wcstod_l wcstof_l wcstol_l wcstold_l wcstoll_l wcstoul_l wcstoull_l wcswidth_l wcsxfrm_l wcwidth_l wprintf_l wscanf_l
143#endif
144
145#endif /* _XLOCALE__WCHAR_H_ */
lib/libc/include/x86_64-macos-gnu/xlocale/_wctype.h created+97
......@@ -0,0 +1,97 @@
1/*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _XLOCALE__WCTYPE_H_
25#define _XLOCALE__WCTYPE_H_
26
27#include <__wctype.h>
28#include <_types/_wctrans_t.h>
29#include <xlocale/_ctype.h>
30
31#if !defined(_DONT_USE_CTYPE_INLINE_) && \
32 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
33
34__DARWIN_WCTYPE_TOP_inline int
35iswblank_l(wint_t _wc, locale_t _l)
36{
37 return (__istype_l(_wc, _CTYPE_B, _l));
38}
39
40__DARWIN_WCTYPE_TOP_inline int
41iswhexnumber_l(wint_t _wc, locale_t _l)
42{
43 return (__istype_l(_wc, _CTYPE_X, _l));
44}
45
46__DARWIN_WCTYPE_TOP_inline int
47iswideogram_l(wint_t _wc, locale_t _l)
48{
49 return (__istype_l(_wc, _CTYPE_I, _l));
50}
51
52__DARWIN_WCTYPE_TOP_inline int
53iswnumber_l(wint_t _wc, locale_t _l)
54{
55 return (__istype_l(_wc, _CTYPE_D, _l));
56}
57
58__DARWIN_WCTYPE_TOP_inline int
59iswphonogram_l(wint_t _wc, locale_t _l)
60{
61 return (__istype_l(_wc, _CTYPE_Q, _l));
62}
63
64__DARWIN_WCTYPE_TOP_inline int
65iswrune_l(wint_t _wc, locale_t _l)
66{
67 return (__istype_l(_wc, 0xFFFFFFF0L, _l));
68}
69
70__DARWIN_WCTYPE_TOP_inline int
71iswspecial_l(wint_t _wc, locale_t _l)
72{
73 return (__istype_l(_wc, _CTYPE_T, _l));
74}
75
76#else /* not using inlines */
77
78__BEGIN_DECLS
79int iswblank_l(wint_t, locale_t);
80wint_t iswhexnumber_l(wint_t, locale_t);
81wint_t iswideogram_l(wint_t, locale_t);
82wint_t iswnumber_l(wint_t, locale_t);
83wint_t iswphonogram_l(wint_t, locale_t);
84wint_t iswrune_l(wint_t, locale_t);
85wint_t iswspecial_l(wint_t, locale_t);
86__END_DECLS
87
88#endif /* using inlines */
89
90__BEGIN_DECLS
91wint_t nextwctype_l(wint_t, wctype_t, locale_t);
92wint_t towctrans_l(wint_t, wctrans_t, locale_t);
93wctrans_t
94 wctrans_l(const char *, locale_t);
95__END_DECLS
96
97#endif /* _XLOCALE__WCTYPE_H_ */