/media/libtremor/lib/os.h

http://github.com/zpao/v8monkey · C Header · 64 lines · 38 code · 10 blank · 16 comment · 0 complexity · 7aa9843e23f1012e99e7f694e3e898fb MD5 · raw file

  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 <ogg/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. # define LITTLE_ENDIAN 1
  38. # define BYTE_ORDER LITTLE_ENDIAN
  39. #endif
  40. #ifdef HAVE_ALLOCA_H
  41. # include <alloca.h>
  42. #endif
  43. #ifdef USE_MEMORY_H
  44. # include <memory.h>
  45. #endif
  46. #ifndef min
  47. # define min(x,y) ((x)>(y)?(y):(x))
  48. #endif
  49. #ifndef max
  50. # define max(x,y) ((x)<(y)?(y):(x))
  51. #endif
  52. #endif /* _OS_H */