os_types.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
  4. * *
  5. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  6. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  7. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  8. * *
  9. * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
  10. * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
  11. * *
  12. ********************************************************************
  13. function: #ifdef jail to whip a few platforms into the UNIX ideal.
  14. ********************************************************************/
  15. #ifndef _OS_TYPES_H
  16. #define _OS_TYPES_H
  17. #ifdef _LOW_ACCURACY_
  18. # define X(n) (((((n)>>22)+1)>>1) - ((((n)>>22)+1)>>9))
  19. # define LOOKUP_T const unsigned char
  20. #else
  21. # define X(n) (n)
  22. # define LOOKUP_T const ogg_int32_t
  23. #endif
  24. /* make it easy on the folks that want to compile the libs with a
  25. different malloc than stdlib */
  26. #define _ogg_malloc malloc
  27. #define _ogg_calloc calloc
  28. #define _ogg_realloc realloc
  29. #define _ogg_free free
  30. #ifdef _WIN32
  31. # ifndef __GNUC__
  32. /* MSVC/Borland */
  33. typedef __int64 ogg_int64_t;
  34. typedef __int32 ogg_int32_t;
  35. typedef unsigned __int32 ogg_uint32_t;
  36. typedef __int16 ogg_int16_t;
  37. typedef unsigned __int16 ogg_uint16_t;
  38. # else
  39. /* Cygwin */
  40. #include <_G_config.h>
  41. typedef _G_int64_t ogg_int64_t;
  42. typedef _G_int32_t ogg_int32_t;
  43. typedef _G_uint32_t ogg_uint32_t;
  44. typedef _G_int16_t ogg_int16_t;
  45. typedef _G_uint16_t ogg_uint16_t;
  46. # endif
  47. #elif defined(__MACOS__)
  48. # include <sys/types.h>
  49. typedef SInt16 ogg_int16_t;
  50. typedef UInt16 ogg_uint16_t;
  51. typedef SInt32 ogg_int32_t;
  52. typedef UInt32 ogg_uint32_t;
  53. typedef SInt64 ogg_int64_t;
  54. #elif defined(__MACOSX__) /* MacOS X Framework build */
  55. # include <sys/types.h>
  56. typedef int16_t ogg_int16_t;
  57. typedef u_int16_t ogg_uint16_t;
  58. typedef int32_t ogg_int32_t;
  59. typedef u_int32_t ogg_uint32_t;
  60. typedef int64_t ogg_int64_t;
  61. #elif defined(__BEOS__)
  62. /* Be */
  63. # include <inttypes.h>
  64. #elif defined (__EMX__)
  65. /* OS/2 GCC */
  66. typedef short ogg_int16_t;
  67. typedef unsigned short ogg_uint16_t;
  68. typedef int ogg_int32_t;
  69. typedef unsigned int ogg_uint32_t;
  70. typedef long long ogg_int64_t;
  71. #else
  72. # include <sys/types.h>
  73. # include "config_types.h"
  74. #endif
  75. #endif /* _OS_TYPES_H */