Moving everything to the same type abstraction (sort of).
[opus.git] / libcelt / celt_types.h
1 /* celt_types.h taken from libogg */
2 /********************************************************************
3  *                                                                  *
4  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
5  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
6  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
7  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
8  *                                                                  *
9  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002             *
10  * by the Xiph.Org Foundation http://www.xiph.org/                  *
11  *                                                                  *
12  ********************************************************************
13
14  function: #ifdef jail to whip a few platforms into the UNIX ideal.
15  last mod: $Id: os_types.h 7524 2004-08-11 04:20:36Z conrad $
16
17  ********************************************************************/
18 /**
19    @file celt_types.h
20    @brief CELT types
21 */
22 #ifndef _CELT_TYPES_H
23 #define _CELT_TYPES_H
24
25 /* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */
26 #if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) )
27 #include <stdint.h>
28
29    typedef int16_t celt_int16_t;
30    typedef uint16_t celt_uint16_t;
31    typedef int32_t celt_int32_t;
32    typedef uint32_t celt_uint32_t;
33    typedef int64_t celt_int64_t;
34    typedef uint64_t celt_uint64_t;
35 #elif defined(_WIN32) 
36
37 #  if defined(__CYGWIN__)
38 #    include <_G_config.h>
39      typedef _G_int32_t celt_int32_t;
40      typedef _G_uint32_t celt_uint32_t;
41      typedef _G_int16_t celt_int16_t;
42      typedef _G_uint16_t celt_uint16_t;
43      typedef _G_int64_t celt_int64_t;
44      typedef _G_uint64_t celt_uint64_t;
45 #  elif defined(__MINGW32__)
46      typedef short celt_int16_t;
47      typedef unsigned short celt_uint16_t;
48      typedef int celt_int32_t;
49      typedef unsigned int celt_uint32_t;
50      typedef long long celt_int64_t;
51      typedef unsigned long long celt_uint64_t;
52 #  elif defined(__MWERKS__)
53      typedef int celt_int32_t;
54      typedef unsigned int celt_uint32_t;
55      typedef short celt_int16_t;
56      typedef unsigned short celt_uint16_t;
57      typedef long long celt_int64_t;
58      typedef unsigned long long celt_uint64_t;
59 #  else
60      /* MSVC/Borland */
61      typedef __int32 celt_int32_t;
62      typedef unsigned __int32 celt_uint32_t;
63      typedef __int16 celt_int16_t;
64      typedef unsigned __int16 celt_uint16_t;
65      typedef __int64 celt_int64_t;
66      typedef unsigned __int64 celt_uint64_t;
67 #  endif
68
69 #elif defined(__MACOS__)
70
71 #  include <sys/types.h>
72    typedef SInt16 celt_int16_t;
73    typedef UInt16 celt_uint16_t;
74    typedef SInt32 celt_int32_t;
75    typedef UInt32 celt_uint32_t;
76    typedef SInt64 celt_int64_t;
77    typedef UInt64 celt_uint64_t;
78
79 #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
80
81 #  include <sys/types.h>
82    typedef int16_t celt_int16_t;
83    typedef u_int16_t celt_uint16_t;
84    typedef int32_t celt_int32_t;
85    typedef u_int32_t celt_uint32_t;
86    typedef int64_t celt_int64_t;
87    typedef u_int64_t celt_uint64_t;
88
89 #elif defined(__BEOS__)
90
91    /* Be */
92 #  include <inttypes.h>
93    typedef int16_t celt_int16_t;
94    typedef u_int16_t celt_uint16_t;
95    typedef int32_t celt_int32_t;
96    typedef u_int32_t celt_uint32_t;
97    typedef int64_t celt_int64_t;
98    typedef u_int64_t celt_uint64_t;
99
100 #elif defined (__EMX__)
101
102    /* OS/2 GCC */
103    typedef short celt_int16_t;
104    typedef unsigned short celt_uint16_t;
105    typedef int celt_int32_t;
106    typedef unsigned int celt_uint32_t;
107    typedef long long celt_int64_t;
108    typedef unsigned long long celt_uint64_t;
109
110 #elif defined (DJGPP)
111
112    /* DJGPP */
113    typedef short celt_int16_t;
114    typedef int celt_int32_t;
115    typedef unsigned int celt_uint32_t;
116    typedef long long celt_int64_t;
117    typedef unsigned long long celt_uint64_t;
118
119 #elif defined(R5900)
120
121    /* PS2 EE */
122    typedef int celt_int32_t;
123    typedef unsigned celt_uint32_t;
124    typedef short celt_int16_t;
125    typedef long celt_int64_t;
126    typedef unsigned long celt_uint64_t;
127
128 #elif defined(__SYMBIAN32__)
129
130    /* Symbian GCC */
131    typedef signed short celt_int16_t;
132    typedef unsigned short celt_uint16_t;
133    typedef signed int celt_int32_t;
134    typedef unsigned int celt_uint32_t;
135    typedef long long int celt_int64_t;
136    typedef unsigned long long int celt_uint64_t;
137
138 #elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
139
140    typedef short celt_int16_t;
141    typedef unsigned short celt_uint16_t;
142    typedef long celt_int32_t;
143    typedef unsigned long celt_uint32_t;
144    typedef long long celt_int64_t;
145    typedef unsigned long long celt_uint64_t;
146
147 #elif defined(CONFIG_TI_C6X)
148
149    typedef short celt_int16_t;
150    typedef unsigned short celt_uint16_t;
151    typedef int celt_int32_t;
152    typedef unsigned int celt_uint32_t;
153    typedef long long int celt_int64_t;
154    typedef unsigned long long int celt_uint64_t;
155
156 #else
157
158    /* Give up, take a reasonable guess */
159    typedef short celt_int16_t;
160    typedef unsigned short celt_uint16_t;
161    typedef long celt_int32_t;
162    typedef unsigned long celt_uint32_t;
163    typedef long long celt_int64_t;
164    typedef unsigned long long celt_uint64_t;
165
166 #endif
167
168 #endif  /* _CELT_TYPES_H */