]> git.saurik.com Git - apple/libc.git/blob - include/_types.h
731e9c82e08361b1d52dd5f781691230392b96dc
[apple/libc.git] / include / _types.h
1 /*
2 * Copyright (c) 1999-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25
26 #ifndef __TYPES_H_
27 #define __TYPES_H_
28
29 #include <sys/_types.h>
30 #include <machine/ansi.h>
31
32 /*
33 * XXX - This block will eventually be relocated into sys/_types.h (or
34 * into a header it calls. It is here temporarily to work can proceed
35 * on the Libc part
36 */
37 #ifndef __OSX_NULL
38 #ifdef __GNUG__
39 #define __OSX_NULL __null
40 #else /* ! __GNUG__ */
41 #ifndef __cplusplus
42 #define __OSX_NULL ((void *)0)
43 #else /* __cplusplus */
44 #define __OSX_NULL 0
45 #endif /* ! __cplusplus */
46 #endif /* __GNUG__ */
47
48 // XXX - renaming from sys/_types.h
49 typedef __mode_t __osx_mode_t;
50 typedef __off_t __osx_off_t;
51 typedef __size_t __osx_size_t;
52 typedef __pid_t __osx_pid_t;
53 typedef __gid_t __osx_gid_t;
54 #endif /* XXX - ! __OSX_NULL */
55
56 typedef _BSD_CT_RUNE_T_ __osx_ct_rune_t;
57 typedef _BSD_MBSTATE_T_ __osx_mbstate_t;
58 typedef int __osx_nl_item;
59 #ifdef _BSD_PTRDIFF_T_
60 typedef _BSD_PTRDIFF_T_ __osx_ptrdiff_t;
61 #endif /* _BSD_PTRDIFF_T_ */
62 typedef _BSD_RUNE_T_ __osx_rune_t;
63 #ifdef __WCHAR_TYPE__
64 typedef __WCHAR_TYPE__ __osx_wchar_t;
65 #else /* ! __WCHAR_TYPE__ */
66 typedef _BSD_WCHAR_T_ __osx_wchar_t;
67 #endif /* __WCHAR_TYPE__ */
68 typedef int __osx_wctrans_t;
69 typedef unsigned long __osx_wctype_t;
70 typedef _BSD_WINT_T_ __osx_wint_t;
71
72 #ifdef __WCHAR_MAX__
73 #define __OSX_WCHAR_MAX __WCHAR_MAX__
74 #else /* ! __WCHAR_MAX__ */
75 #define __OSX_WCHAR_MAX (sizeof(__osx_wchar_t) == 2 ? 0xffff : 0x7fffffff)
76 #endif /* __WCHAR_MAX__ */
77
78 #define __OSX_WCHAR_MIN (sizeof(__osx_wchar_t) == 2 ? 0 : 0x80000000)
79 #define __OSX_WEOF ((__osx_wint_t)-1)
80
81 #endif /* __TYPES_H_ */