a7e00414b76808caf9796fa550a922a9855fc57b
[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.3 2000/05/01 05:46:47 jon Exp $
18
19  ********************************************************************/
20
21 #ifndef _V_IFDEFJAIL_H_
22 #define _V_IFDEFJAIL_H_
23
24 #ifndef M_PI
25 #define M_PI (3.1415926539)
26 #endif
27
28 #ifndef rint
29 /* not strictly correct, but Vorbis doesn't care */
30 #define rint(x)   (floor((x)+0.5)) 
31 #endif
32
33 #ifndef alloca
34 #ifdef _WIN32
35 #  define alloca(x) (_alloca(x))
36 #endif
37 #endif
38
39 #ifdef _WIN32
40 typedef __int64 int64_t;
41 typedef unsigned int u_int32_t;
42 #  define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))
43 #else // if not _WIN32
44 #  define FAST_HYPOT hypot
45 #endif
46
47 #endif
48
49 #endif // _OS_H
50