summaryrefslogtreecommitdiff
path: root/os.h
diff options
context:
space:
mode:
authorRobin Watts <robin@xiph.org>2010-05-15 13:27:10 +0000
committerRobin Watts <robin@xiph.org>2010-05-15 13:27:10 +0000
commit83fddbc0041ca1122f50147b3aa7a8442aa293b2 (patch)
tree7ad035624b947eb8b81fb94478b18d4453325aaa /os.h
downloadtremor-83fddbc0041ca1122f50147b3aa7a8442aa293b2.tar.gz
Create a branch to merge Tremolo optimisations into
git-svn-id: https://svn.xiph.org/branches/lowmem-branch/Tremolo@17216 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'os.h')
-rw-r--r--os.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/os.h b/os.h
new file mode 100644
index 0000000..65a4992
--- /dev/null
+++ b/os.h
@@ -0,0 +1,62 @@
+#ifndef _OS_H
+#define _OS_H
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
+ * *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: #ifdef jail to whip a few platforms into the UNIX ideal.
+
+ ********************************************************************/
+
+#include <math.h>
+#include "os_types.h"
+
+#ifndef _V_IFDEFJAIL_H_
+# define _V_IFDEFJAIL_H_
+
+# ifdef __GNUC__
+# define STIN static __inline__
+# elif _WIN32
+# define STIN static __inline
+# endif
+#else
+# define STIN static
+#endif
+
+#ifndef M_PI
+# define M_PI (3.1415926536f)
+#endif
+
+#ifdef _WIN32
+# include <malloc.h>
+# define rint(x) (floor((x)+0.5f))
+# define NO_FLOAT_MATH_LIB
+# define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))
+#endif
+
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
+
+#ifdef USE_MEMORY_H
+# include <memory.h>
+#endif
+
+#ifndef min
+# define min(x,y) ((x)>(y)?(y):(x))
+#endif
+
+#ifndef max
+# define max(x,y) ((x)<(y)?(y):(x))
+#endif
+
+#endif /* _OS_H */