xref: /xnu-8020.101.4/bsd/arm/_types.h (revision e7776783b89a353188416a9a346c6cdb4928faad)
1*e7776783SApple OSS Distributions /*
2*e7776783SApple OSS Distributions  * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3*e7776783SApple OSS Distributions  */
4*e7776783SApple OSS Distributions #ifndef _BSD_ARM__TYPES_H_
5*e7776783SApple OSS Distributions #define _BSD_ARM__TYPES_H_
6*e7776783SApple OSS Distributions 
7*e7776783SApple OSS Distributions #if defined (__arm__) || defined (__arm64__)
8*e7776783SApple OSS Distributions 
9*e7776783SApple OSS Distributions /*
10*e7776783SApple OSS Distributions  * This header file contains integer types.  It's intended to also contain
11*e7776783SApple OSS Distributions  * flotaing point and other arithmetic types, as needed, later.
12*e7776783SApple OSS Distributions  */
13*e7776783SApple OSS Distributions 
14*e7776783SApple OSS Distributions #ifdef __GNUC__
15*e7776783SApple OSS Distributions typedef __signed char           __int8_t;
16*e7776783SApple OSS Distributions #else   /* !__GNUC__ */
17*e7776783SApple OSS Distributions typedef char                    __int8_t;
18*e7776783SApple OSS Distributions #endif  /* !__GNUC__ */
19*e7776783SApple OSS Distributions typedef unsigned char           __uint8_t;
20*e7776783SApple OSS Distributions typedef short                   __int16_t;
21*e7776783SApple OSS Distributions typedef unsigned short          __uint16_t;
22*e7776783SApple OSS Distributions typedef int                     __int32_t;
23*e7776783SApple OSS Distributions typedef unsigned int            __uint32_t;
24*e7776783SApple OSS Distributions typedef long long               __int64_t;
25*e7776783SApple OSS Distributions typedef unsigned long long      __uint64_t;
26*e7776783SApple OSS Distributions 
27*e7776783SApple OSS Distributions typedef long                    __darwin_intptr_t;
28*e7776783SApple OSS Distributions typedef unsigned int            __darwin_natural_t;
29*e7776783SApple OSS Distributions 
30*e7776783SApple OSS Distributions /*
31*e7776783SApple OSS Distributions  * The rune type below is declared to be an ``int'' instead of the more natural
32*e7776783SApple OSS Distributions  * ``unsigned long'' or ``long''.  Two things are happening here.  It is not
33*e7776783SApple OSS Distributions  * unsigned so that EOF (-1) can be naturally assigned to it and used.  Also,
34*e7776783SApple OSS Distributions  * it looks like 10646 will be a 31 bit standard.  This means that if your
35*e7776783SApple OSS Distributions  * ints cannot hold 32 bits, you will be in trouble.  The reason an int was
36*e7776783SApple OSS Distributions  * chosen over a long is that the is*() and to*() routines take ints (says
37*e7776783SApple OSS Distributions  * ANSI C), but they use __darwin_ct_rune_t instead of int.  By changing it
38*e7776783SApple OSS Distributions  * here, you lose a bit of ANSI conformance, but your programs will still
39*e7776783SApple OSS Distributions  * work.
40*e7776783SApple OSS Distributions  *
41*e7776783SApple OSS Distributions  * NOTE: rune_t is not covered by ANSI nor other standards, and should not
42*e7776783SApple OSS Distributions  * be instantiated outside of lib/libc/locale.  Use wchar_t.  wchar_t and
43*e7776783SApple OSS Distributions  * rune_t must be the same type.  Also wint_t must be no narrower than
44*e7776783SApple OSS Distributions  * wchar_t, and should also be able to hold all members of the largest
45*e7776783SApple OSS Distributions  * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
46*e7776783SApple OSS Distributions  */
47*e7776783SApple OSS Distributions 
48*e7776783SApple OSS Distributions typedef int                     __darwin_ct_rune_t;     /* ct_rune_t */
49*e7776783SApple OSS Distributions 
50*e7776783SApple OSS Distributions /*
51*e7776783SApple OSS Distributions  * mbstate_t is an opaque object to keep conversion state, during multibyte
52*e7776783SApple OSS Distributions  * stream conversions.  The content must not be referenced by user programs.
53*e7776783SApple OSS Distributions  */
54*e7776783SApple OSS Distributions typedef union {
55*e7776783SApple OSS Distributions 	char            __mbstate8[128];
56*e7776783SApple OSS Distributions 	long long       _mbstateL;                      /* for alignment */
57*e7776783SApple OSS Distributions } __mbstate_t;
58*e7776783SApple OSS Distributions 
59*e7776783SApple OSS Distributions typedef __mbstate_t             __darwin_mbstate_t;     /* mbstate_t */
60*e7776783SApple OSS Distributions 
61*e7776783SApple OSS Distributions #if defined(__PTRDIFF_TYPE__)
62*e7776783SApple OSS Distributions typedef __PTRDIFF_TYPE__        __darwin_ptrdiff_t;     /* ptr1 - ptr2 */
63*e7776783SApple OSS Distributions #elif defined(__LP64__)
64*e7776783SApple OSS Distributions typedef long                    __darwin_ptrdiff_t;     /* ptr1 - ptr2 */
65*e7776783SApple OSS Distributions #else
66*e7776783SApple OSS Distributions typedef int                     __darwin_ptrdiff_t;     /* ptr1 - ptr2 */
67*e7776783SApple OSS Distributions #endif /* __GNUC__ */
68*e7776783SApple OSS Distributions 
69*e7776783SApple OSS Distributions #if defined(__SIZE_TYPE__)
70*e7776783SApple OSS Distributions typedef __SIZE_TYPE__           __darwin_size_t;        /* sizeof() */
71*e7776783SApple OSS Distributions #else
72*e7776783SApple OSS Distributions typedef unsigned long           __darwin_size_t;        /* sizeof() */
73*e7776783SApple OSS Distributions #endif
74*e7776783SApple OSS Distributions 
75*e7776783SApple OSS Distributions #if (__GNUC__ > 2)
76*e7776783SApple OSS Distributions typedef __builtin_va_list       __darwin_va_list;       /* va_list */
77*e7776783SApple OSS Distributions #else
78*e7776783SApple OSS Distributions typedef void *                  __darwin_va_list;       /* va_list */
79*e7776783SApple OSS Distributions #endif
80*e7776783SApple OSS Distributions 
81*e7776783SApple OSS Distributions #if defined(__WCHAR_TYPE__)
82*e7776783SApple OSS Distributions typedef __WCHAR_TYPE__          __darwin_wchar_t;       /* wchar_t */
83*e7776783SApple OSS Distributions #else
84*e7776783SApple OSS Distributions typedef __darwin_ct_rune_t      __darwin_wchar_t;       /* wchar_t */
85*e7776783SApple OSS Distributions #endif
86*e7776783SApple OSS Distributions 
87*e7776783SApple OSS Distributions typedef __darwin_wchar_t        __darwin_rune_t;        /* rune_t */
88*e7776783SApple OSS Distributions 
89*e7776783SApple OSS Distributions #if defined(__WINT_TYPE__)
90*e7776783SApple OSS Distributions typedef __WINT_TYPE__           __darwin_wint_t;        /* wint_t */
91*e7776783SApple OSS Distributions #else
92*e7776783SApple OSS Distributions typedef __darwin_ct_rune_t      __darwin_wint_t;        /* wint_t */
93*e7776783SApple OSS Distributions #endif
94*e7776783SApple OSS Distributions 
95*e7776783SApple OSS Distributions typedef unsigned long           __darwin_clock_t;       /* clock() */
96*e7776783SApple OSS Distributions typedef __uint32_t              __darwin_socklen_t;     /* socklen_t (duh) */
97*e7776783SApple OSS Distributions typedef long                    __darwin_ssize_t;       /* byte count or error */
98*e7776783SApple OSS Distributions typedef long                    __darwin_time_t;        /* time() */
99*e7776783SApple OSS Distributions 
100*e7776783SApple OSS Distributions #endif /* defined (__arm__) || defined (__arm64__) */
101*e7776783SApple OSS Distributions 
102*e7776783SApple OSS Distributions #endif  /* _BSD_ARM__TYPES_H_ */
103