97e1bf3079b55adffbd0fc2b9f9af7d8ebe60773
[platform/upstream/libvorbis.git] / lib / os.h
1 #ifndef _OS_H
2 #define _OS_H
3 /********************************************************************
4  *                                                                  *
5  * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE.  *
6  * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
7  * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE.    *
8  * PLEASE READ THESE TERMS DISTRIBUTING.                            *
9  *                                                                  *
10  * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-2000             *
11  * by Monty <monty@xiph.org> and The XIPHOPHORUS Company            *
12  * http://www.xiph.org/                                             *
13  *                                                                  *
14  ********************************************************************
15
16  function: #ifdef jail to whip a few platforms into the UNIX ideal.
17  last mod: $Id: os.h,v 1.10 2000/10/12 03:12:53 xiphmont Exp $
18
19  ********************************************************************/
20
21 #include <math.h>
22 #ifndef _V_IFDEFJAIL_H_
23 #define _V_IFDEFJAIL_H_
24
25 #ifndef M_PI
26 #define M_PI (3.1415926539)
27 #endif
28
29 #ifndef __GNUC__
30 #ifdef _WIN32
31 #  include <malloc.h>
32 #  define rint(x)   (floor((x)+0.5)) 
33 #endif
34 #endif
35
36 #ifdef _WIN32
37 #  define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))
38 #else /* if not _WIN32 */
39 #  define FAST_HYPOT hypot
40 #endif
41
42 #endif
43
44 #ifdef HAVE_ALLOCA_H
45 #include <alloca.h>
46 #endif
47
48 #ifdef USE_MEMORY_H
49 #include <memory.h>
50 #endif
51
52 #ifndef min
53 #  define min(x,y)  ((x)>(y)?(y):(x))
54 #endif
55
56 #ifndef max
57 #  define max(x,y)  ((x)<(y)?(y):(x))
58 #endif
59
60 #endif /* _OS_H */