os.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. function: #ifdef jail to whip a few platforms into the UNIX ideal.
  16. last mod: $Id: os.h,v 1.9.4.2 2000/09/12 22:48:56 jack Exp $
  17. ********************************************************************/
  18. #include <math.h>
  19. #ifndef _V_IFDEFJAIL_H_
  20. #define _V_IFDEFJAIL_H_
  21. #ifndef M_PI
  22. #define M_PI (3.1415926539)
  23. #endif
  24. #ifndef __GNUC__
  25. #ifdef _WIN32
  26. # include <malloc.h>
  27. # define rint(x) (floor((x)+0.5))
  28. #endif
  29. #endif
  30. #ifdef _WIN32
  31. # define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))
  32. #else /* if not _WIN32 */
  33. # define FAST_HYPOT hypot
  34. #endif
  35. #endif
  36. #ifdef HAVE_ALLOCA_H
  37. #include <alloca.h>
  38. #endif
  39. #ifdef USE_MEMORY_H
  40. #include <memory.h>
  41. #endif
  42. #ifndef min
  43. # define min(x,y) ((x)>(y)?(y):(x))
  44. #endif
  45. #ifndef max
  46. # define max(x,y) ((x)<(y)?(y):(x))
  47. #endif
  48. #endif /* _OS_H */