]> git.saurik.com Git - apple/xnu.git/blob - libkern/libkern/OSTypes.h
62d8a81b052ec899df257a0b6bcf60a3eb31cd2d
[apple/xnu.git] / libkern / libkern / OSTypes.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30 /*
31 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
32 *
33 * HISTORY
34 *
35 */
36
37 #ifndef _OS_OSTYPES_H
38 #define _OS_OSTYPES_H
39
40 typedef unsigned int UInt;
41 typedef signed int SInt;
42
43 #ifndef __MACTYPES__ /* CF MacTypes.h */
44 #ifndef __TYPES__ /* guess... Mac Types.h */
45
46 typedef unsigned char UInt8;
47 typedef unsigned short UInt16;
48 typedef unsigned long UInt32;
49 typedef unsigned long long UInt64;
50 #if defined(__BIG_ENDIAN__)
51 typedef struct UnsignedWide {
52 UInt32 hi;
53 UInt32 lo;
54 } UnsignedWide;
55 #elif defined(__LITTLE_ENDIAN__)
56 typedef struct UnsignedWide {
57 UInt32 lo;
58 UInt32 hi;
59 } UnsignedWide;
60 #else
61 #error Unknown endianess.
62 #endif
63
64 typedef signed char SInt8;
65 typedef signed short SInt16;
66 typedef signed long SInt32;
67 typedef signed long long SInt64;
68 #if defined(__BIG_ENDIAN__)
69 typedef struct wide {
70 SInt32 hi;
71 UInt32 lo;
72 } wide;
73 #elif defined(__LITTLE_ENDIAN__)
74 typedef struct wide {
75 UInt32 lo;
76 SInt32 hi;
77 } wide;
78 #else
79 #error Unknown endianess.
80 #endif
81
82 typedef SInt32 OSStatus;
83 typedef UnsignedWide AbsoluteTime;
84 typedef UInt32 OptionBits;
85
86 typedef unsigned char Boolean;
87
88 #endif /* __TYPES__ */
89 #endif /* __MACTYPES__ */
90
91 #if !defined(OS_INLINE)
92 # define OS_INLINE static inline
93 #endif
94
95 #endif /* _OS_OSTYPES_H */