1 | /******************************************************************** |
2 | * * |
3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * |
4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * |
5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * |
6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * |
7 | * * |
8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * |
9 | * by the Xiph.Org Foundation http://www.xiph.org/ * |
10 | * * |
11 | ******************************************************************** |
12 | |
13 | function: Define a consistent set of types on each platform. |
14 | |
15 | ********************************************************************/ |
16 | #ifndef _OS_TYPES_H |
17 | #define _OS_TYPES_H |
18 | |
19 | /* make it easy on the folks that want to compile the libs with a |
20 | different malloc than stdlib */ |
21 | #define _ogg_malloc malloc |
22 | #define _ogg_calloc calloc |
23 | #define _ogg_realloc realloc |
24 | #define _ogg_free free |
25 | |
26 | #if defined(_WIN32) |
27 | |
28 | # if defined(__CYGWIN__) |
29 | # include <stdint.h> |
30 | typedef int16_t ogg_int16_t; |
31 | typedef uint16_t ogg_uint16_t; |
32 | typedef int32_t ogg_int32_t; |
33 | typedef uint32_t ogg_uint32_t; |
34 | typedef int64_t ogg_int64_t; |
35 | typedef uint64_t ogg_uint64_t; |
36 | # elif defined(__MINGW32__) |
37 | # include <sys/types.h> |
38 | typedef short ogg_int16_t; |
39 | typedef unsigned short ogg_uint16_t; |
40 | typedef int ogg_int32_t; |
41 | typedef unsigned int ogg_uint32_t; |
42 | typedef long long ogg_int64_t; |
43 | typedef unsigned long long ogg_uint64_t; |
44 | # elif defined(__MWERKS__) |
45 | typedef long long ogg_int64_t; |
46 | typedef unsigned long long ogg_uint64_t; |
47 | typedef int ogg_int32_t; |
48 | typedef unsigned int ogg_uint32_t; |
49 | typedef short ogg_int16_t; |
50 | typedef unsigned short ogg_uint16_t; |
51 | # else |
52 | # if defined(_MSC_VER) && (_MSC_VER >= 1800) /* MSVC 2013 and newer */ |
53 | # include <stdint.h> |
54 | typedef int16_t ogg_int16_t; |
55 | typedef uint16_t ogg_uint16_t; |
56 | typedef int32_t ogg_int32_t; |
57 | typedef uint32_t ogg_uint32_t; |
58 | typedef int64_t ogg_int64_t; |
59 | typedef uint64_t ogg_uint64_t; |
60 | # else |
61 | /* MSVC/Borland */ |
62 | typedef __int64 ogg_int64_t; |
63 | typedef __int32 ogg_int32_t; |
64 | typedef unsigned __int32 ogg_uint32_t; |
65 | typedef unsigned __int64 ogg_uint64_t; |
66 | typedef __int16 ogg_int16_t; |
67 | typedef unsigned __int16 ogg_uint16_t; |
68 | # endif |
69 | # endif |
70 | |
71 | #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ |
72 | |
73 | # include <sys/types.h> |
74 | typedef int16_t ogg_int16_t; |
75 | typedef u_int16_t ogg_uint16_t; |
76 | typedef int32_t ogg_int32_t; |
77 | typedef u_int32_t ogg_uint32_t; |
78 | typedef int64_t ogg_int64_t; |
79 | typedef u_int64_t ogg_uint64_t; |
80 | |
81 | #elif defined(__HAIKU__) |
82 | |
83 | /* Haiku */ |
84 | # include <sys/types.h> |
85 | typedef short ogg_int16_t; |
86 | typedef unsigned short ogg_uint16_t; |
87 | typedef int ogg_int32_t; |
88 | typedef unsigned int ogg_uint32_t; |
89 | typedef long long ogg_int64_t; |
90 | typedef unsigned long long ogg_uint64_t; |
91 | |
92 | #elif defined(__BEOS__) |
93 | |
94 | /* Be */ |
95 | # include <inttypes.h> |
96 | typedef int16_t ogg_int16_t; |
97 | typedef uint16_t ogg_uint16_t; |
98 | typedef int32_t ogg_int32_t; |
99 | typedef uint32_t ogg_uint32_t; |
100 | typedef int64_t ogg_int64_t; |
101 | typedef uint64_t ogg_uint64_t; |
102 | |
103 | #elif defined (__EMX__) |
104 | |
105 | /* OS/2 GCC */ |
106 | typedef short ogg_int16_t; |
107 | typedef unsigned short ogg_uint16_t; |
108 | typedef int ogg_int32_t; |
109 | typedef unsigned int ogg_uint32_t; |
110 | typedef long long ogg_int64_t; |
111 | typedef unsigned long long ogg_uint64_t; |
112 | |
113 | |
114 | #elif defined (DJGPP) |
115 | |
116 | /* DJGPP */ |
117 | typedef short ogg_int16_t; |
118 | typedef int ogg_int32_t; |
119 | typedef unsigned int ogg_uint32_t; |
120 | typedef long long ogg_int64_t; |
121 | typedef unsigned long long ogg_uint64_t; |
122 | |
123 | #elif defined(R5900) |
124 | |
125 | /* PS2 EE */ |
126 | typedef long ogg_int64_t; |
127 | typedef unsigned long ogg_uint64_t; |
128 | typedef int ogg_int32_t; |
129 | typedef unsigned ogg_uint32_t; |
130 | typedef short ogg_int16_t; |
131 | |
132 | #elif defined(__SYMBIAN32__) |
133 | |
134 | /* Symbian GCC */ |
135 | typedef signed short ogg_int16_t; |
136 | typedef unsigned short ogg_uint16_t; |
137 | typedef signed int ogg_int32_t; |
138 | typedef unsigned int ogg_uint32_t; |
139 | typedef long long int ogg_int64_t; |
140 | typedef unsigned long long int ogg_uint64_t; |
141 | |
142 | #elif defined(__TMS320C6X__) |
143 | |
144 | /* TI C64x compiler */ |
145 | typedef signed short ogg_int16_t; |
146 | typedef unsigned short ogg_uint16_t; |
147 | typedef signed int ogg_int32_t; |
148 | typedef unsigned int ogg_uint32_t; |
149 | typedef long long int ogg_int64_t; |
150 | typedef unsigned long long int ogg_uint64_t; |
151 | |
152 | #else |
153 | |
154 | # include <ogg/config_types.h> |
155 | |
156 | #endif |
157 | |
158 | #endif /* _OS_TYPES_H */ |
159 | |