blob: 1549b80962524c53c1f2c047989c1678934559fb [file] [log] [blame]
Gloria Wang79130732010-02-08 14:41:04 -08001/********************************************************************
2 * *
3 * THIS FILE IS PART OF THE Theorarm SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5 * GOVERNED BY A SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
7 * *
8 * THE Theora/Tremor SOURCE CODE IS COPYRIGHT (C) 2002-2009 *
9 * by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
10 * Modifications/Additions Copyright (C) 2009 Robin Watts for *
11 * Pinknoise Productions Ltd. *
12 * *
13 ********************************************************************
14
15 function: #ifdef jail to whip a few platforms into the UNIX ideal.
16
17 ********************************************************************/
18#ifndef _OS_TYPES_H
19#define _OS_TYPES_H
20
21#ifdef _LOW_ACCURACY_
22# define X(n) (((((n)>>22)+1)>>1) - ((((n)>>22)+1)>>9))
23# define LOOKUP_T const unsigned char
24#else
25# define X(n) (n)
26# define LOOKUP_T const ogg_int32_t
27#endif
28
29/* make it easy on the folks that want to compile the libs with a
30 different malloc than stdlib */
31#define _ogg_malloc malloc
32#define _ogg_calloc calloc
33#define _ogg_realloc realloc
34#define _ogg_free free
35
36#if defined (_WIN32_WCE)
37
38 typedef unsigned short ogg_uint16_t;
39 typedef short ogg_int16_t;
40 typedef int ogg_int32_t;
41 typedef unsigned int ogg_uint32_t;
42 typedef __int64 ogg_int64_t;
43
44 #define inline
45
46#elif defined(_WIN32)
47
48# ifndef __GNUC__
49 /* MSVC/Borland */
50 typedef __int64 ogg_int64_t;
51 typedef __int32 ogg_int32_t;
52 typedef unsigned __int32 ogg_uint32_t;
53 typedef __int16 ogg_int16_t;
54 typedef unsigned __int16 ogg_uint16_t;
55# else
56 /* Cygwin */
57 #include <_G_config.h>
58 typedef _G_int64_t ogg_int64_t;
59 typedef _G_int32_t ogg_int32_t;
60 typedef _G_uint32_t ogg_uint32_t;
61 typedef _G_int16_t ogg_int16_t;
62 typedef _G_uint16_t ogg_uint16_t;
63# endif
64
65#elif defined(__MACOS__)
66
67# include <sys/types.h>
68 typedef SInt16 ogg_int16_t;
69 typedef UInt16 ogg_uint16_t;
70 typedef SInt32 ogg_int32_t;
71 typedef UInt32 ogg_uint32_t;
72 typedef SInt64 ogg_int64_t;
73
74#elif defined(__MACOSX__) /* MacOS X Framework build */
75
76# include <sys/types.h>
77 typedef int16_t ogg_int16_t;
78 typedef u_int16_t ogg_uint16_t;
79 typedef int32_t ogg_int32_t;
80 typedef u_int32_t ogg_uint32_t;
81 typedef int64_t ogg_int64_t;
82
83#elif defined(__BEOS__)
84
85 /* Be */
86# include <inttypes.h>
87
88#elif defined (__EMX__)
89
90 /* OS/2 GCC */
91 typedef short ogg_int16_t;
92 typedef unsigned short ogg_uint16_t;
93 typedef int ogg_int32_t;
94 typedef unsigned int ogg_uint32_t;
95 typedef long long ogg_int64_t;
96
97#else
98
99# include <sys/types.h>
100# include "config_types.h"
101
102#endif
103
104#endif /* _OS_TYPES_H */