os.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef _OS_H
  2. #define _OS_H
  3. /********************************************************************
  4. * *
  5. * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
  6. * *
  7. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  8. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  9. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  10. * *
  11. * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
  12. * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
  13. * *
  14. ********************************************************************
  15. function: #ifdef jail to whip a few platforms into the UNIX ideal.
  16. ********************************************************************/
  17. #include <math.h>
  18. #include "os_types.h"
  19. #ifndef _V_IFDEFJAIL_H_
  20. # define _V_IFDEFJAIL_H_
  21. # ifdef __GNUC__
  22. # define STIN static __inline__
  23. # elif _WIN32
  24. # define STIN static __inline
  25. # endif
  26. #else
  27. # define STIN static
  28. #endif
  29. #ifndef M_PI
  30. # define M_PI (3.1415926536f)
  31. #endif
  32. #ifdef _WIN32
  33. # include <malloc.h>
  34. # define rint(x) (floor((x)+0.5f))
  35. # define NO_FLOAT_MATH_LIB
  36. # define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))
  37. #endif
  38. #ifdef HAVE_ALLOCA_H
  39. # include <alloca.h>
  40. #endif
  41. #ifdef USE_MEMORY_H
  42. # include <memory.h>
  43. #endif
  44. #ifndef min
  45. # define min(x,y) ((x)>(y)?(y):(x))
  46. #endif
  47. #ifndef max
  48. # define max(x,y) ((x)<(y)?(y):(x))
  49. #endif
  50. #endif /* _OS_H */