annotate tremor/os.h @ 21221:7124c26f3db3

Add generic target that allow compiling without any assembler or otherwise architecture specific code (except endiannes of course). Usage example: ./configure --target=generic-linux
author reimar
date Sat, 25 Nov 2006 17:58:33 +0000
parents cd6b211be811
children fe50eaad932d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14280
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
1 #ifndef _OS_H
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
2 #define _OS_H
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
3 /********************************************************************
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
4 * *
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
5 * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
6 * *
19251
cd6b211be811 Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents: 14280
diff changeset
7 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
cd6b211be811 Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents: 14280
diff changeset
8 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
cd6b211be811 Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents: 14280
diff changeset
9 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
cd6b211be811 Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents: 14280
diff changeset
10 * *
14280
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
11 * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
12 * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
13 * *
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
14 ********************************************************************
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
15
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
16 function: #ifdef jail to whip a few platforms into the UNIX ideal.
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
17
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
18 ********************************************************************/
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
19
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
20 #include <math.h>
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
21 #include "os_types.h"
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
22
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
23 #ifndef _V_IFDEFJAIL_H_
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
24 # define _V_IFDEFJAIL_H_
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
25
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
26 # ifdef __GNUC__
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
27 # define STIN static __inline__
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
28 # elif _WIN32
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
29 # define STIN static __inline
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
30 # endif
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
31 #else
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
32 # define STIN static
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
33 #endif
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
34
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
35 #ifndef M_PI
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
36 # define M_PI (3.1415926536f)
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
37 #endif
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
38
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
39 #ifdef _WIN32
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
40 # include <malloc.h>
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
41 # define rint(x) (floor((x)+0.5f))
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
42 # define NO_FLOAT_MATH_LIB
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
43 # define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
44 #endif
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
45
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
46 #ifdef HAVE_ALLOCA_H
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
47 # include <alloca.h>
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
48 #endif
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
49
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
50 #ifdef USE_MEMORY_H
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
51 # include <memory.h>
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
52 #endif
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
53
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
54 #ifndef min
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
55 # define min(x,y) ((x)>(y)?(y):(x))
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
56 #endif
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
57
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
58 #ifndef max
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
59 # define max(x,y) ((x)<(y)?(y):(x))
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
60 #endif
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
61
8631a3803289 internal Tremor decoder for Ogg/Vorbis
henry
parents:
diff changeset
62 #endif /* _OS_H */