doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
os_types.h
Go to the documentation of this file.
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: #ifdef jail to whip a few platforms into the UNIX ideal.
14  last mod: $Id: os_types.h,v 1.14 2003/09/02 05:09:14 xiphmont Exp $
15 
16  ********************************************************************/
17 #ifndef _OS_TYPES_H
18 #define _OS_TYPES_H
19 
20 /* make it easy on the folks that want to compile the libs with a
21  different malloc than stdlib */
22 
23 // using private thread safe memory allocator for DOOM
24 #if 1
25 
26 #include <stddef.h>
27 #if !__MACH__ && __MWERKS__
28 #include <types.h>
29 #else
30 #include <sys/types.h>
31 #endif
32 
33 void *_decoder_malloc( size_t size );
34 void *_decoder_calloc( size_t num, size_t size );
35 void *_decoder_realloc( void *memblock, size_t size );
36 void _decoder_free( void *memblock );
37 
38 #define _ogg_malloc _decoder_malloc
39 #define _ogg_calloc _decoder_calloc
40 #define _ogg_realloc _decoder_realloc
41 #define _ogg_free _decoder_free
42 
43 #else
44 
45 #define _ogg_malloc malloc
46 #define _ogg_calloc calloc
47 #define _ogg_realloc realloc
48 #define _ogg_free free
49 
50 #endif
51 
52 #ifdef _WIN32
53 
54 # ifndef __GNUC__
55  /* MSVC/Borland */
56  typedef __int64 ogg_int64_t;
57  typedef __int32 ogg_int32_t;
58  typedef unsigned __int32 ogg_uint32_t;
59  typedef __int16 ogg_int16_t;
60  typedef unsigned __int16 ogg_uint16_t;
61 
62 #pragma warning(disable : 4018) // signed/unsigned mismatch
63 #pragma warning(disable : 4146) // unary minus operator applied to unsigned type, result still unsigned
64 #pragma warning(disable : 4244) // conversion to smaller type, possible loss of data
65 #pragma warning(disable : 4305) // truncation from 'double' to 'float'
66 
67 # else
68  /* Cygwin */
69  #include <_G_config.h>
70  typedef _G_int64_t ogg_int64_t;
71  typedef _G_int32_t ogg_int32_t;
72  typedef _G_uint32_t ogg_uint32_t;
73  typedef _G_int16_t ogg_int16_t;
74  typedef _G_uint16_t ogg_uint16_t;
75 # endif
76 
77 #elif defined(MACOS_X) /* MacOS X Framework build */
78 
79 # include <sys/types.h>
80  typedef int16_t ogg_int16_t;
81  typedef u_int16_t ogg_uint16_t;
82  typedef int32_t ogg_int32_t;
83  typedef u_int32_t ogg_uint32_t;
84  typedef int64_t ogg_int64_t;
85 
86 #elif defined(__MACOS__)
87 
88 # include <types.h>
89  typedef SInt16 ogg_int16_t;
90  typedef UInt16 ogg_uint16_t;
91  typedef SInt32 ogg_int32_t;
92  typedef UInt32 ogg_uint32_t;
93  typedef SInt64 ogg_int64_t;
94 
95 #elif defined(__BEOS__)
96 
97  /* Be */
98 # include <inttypes.h>
99  typedef int16_t ogg_int16_t;
100  typedef u_int16_t ogg_uint16_t;
101  typedef int32_t ogg_int32_t;
102  typedef u_int32_t ogg_uint32_t;
103  typedef int64_t ogg_int64_t;
104 
105 #elif defined (__EMX__)
106 
107  /* OS/2 GCC */
108  typedef short ogg_int16_t;
109  typedef unsigned short ogg_uint16_t;
110  typedef int ogg_int32_t;
111  typedef unsigned int ogg_uint32_t;
112  typedef long long ogg_int64_t;
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 
122 #elif defined(R5900)
123 
124  /* PS2 EE */
125  typedef long ogg_int64_t;
126  typedef int ogg_int32_t;
127  typedef unsigned ogg_uint32_t;
128  typedef short ogg_int16_t;
129 
130 #else
131 
132 # include <sys/types.h>
133 //# include <ogg/config_types.h>
134 // copied from a system install of config_types.h
135 /* these are filled in by configure */
136 typedef int16_t ogg_int16_t;
137 typedef u_int16_t ogg_uint16_t;
138 typedef int32_t ogg_int32_t;
139 typedef u_int32_t ogg_uint32_t;
140 typedef int64_t ogg_int64_t;
141 
142 
143 #endif
144 
145 #endif /* _OS_TYPES_H */
u_int32_t ogg_uint32_t
Definition: os_types.h:139
void * _decoder_calloc(size_t num, size_t size)
Definition: snd_decoder.cpp:64
GLuint GLuint num
Definition: glext.h:5390
u_int16_t ogg_uint16_t
Definition: os_types.h:137
void _decoder_free(void *memblock)
Definition: snd_decoder.cpp:77
void * _decoder_realloc(void *memblock, size_t size)
Definition: snd_decoder.cpp:71
void * _decoder_malloc(size_t size)
Definition: snd_decoder.cpp:58
int16_t ogg_int16_t
Definition: os_types.h:136
GLsizeiptr size
Definition: glext.h:3112
int64_t ogg_int64_t
Definition: os_types.h:140
int32_t ogg_int32_t
Definition: os_types.h:138