os_types.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  5. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  6. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
  9. * by the Xiph.Org Foundation http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function: #ifdef jail to whip a few platforms into the UNIX ideal.
  13. last mod: $Id: os_types.h 19098 2014-02-26 19:06:45Z giles $
  14. ********************************************************************/
  15. #ifndef _OS_TYPES_H
  16. #define _OS_TYPES_H
  17. /* make it easy on the folks that want to compile the libs with a
  18. different malloc than stdlib */
  19. #define _ogg_malloc malloc
  20. #define _ogg_calloc calloc
  21. #define _ogg_realloc realloc
  22. #define _ogg_free free
  23. #if defined(_WIN32)
  24. # if defined(__CYGWIN__)
  25. # include <stdint.h>
  26. typedef int16_t ogg_int16_t;
  27. typedef uint16_t ogg_uint16_t;
  28. typedef int32_t ogg_int32_t;
  29. typedef uint32_t ogg_uint32_t;
  30. typedef int64_t ogg_int64_t;
  31. typedef uint64_t ogg_uint64_t;
  32. # elif defined(__MINGW32__)
  33. # include <sys/types.h>
  34. typedef short ogg_int16_t;
  35. typedef unsigned short ogg_uint16_t;
  36. typedef int ogg_int32_t;
  37. typedef unsigned int ogg_uint32_t;
  38. typedef long long ogg_int64_t;
  39. typedef unsigned long long ogg_uint64_t;
  40. # elif defined(__MWERKS__)
  41. typedef long long ogg_int64_t;
  42. typedef int ogg_int32_t;
  43. typedef unsigned int ogg_uint32_t;
  44. typedef short ogg_int16_t;
  45. typedef unsigned short ogg_uint16_t;
  46. # else
  47. /* MSVC/Borland */
  48. typedef __int64 ogg_int64_t;
  49. typedef __int32 ogg_int32_t;
  50. typedef unsigned __int32 ogg_uint32_t;
  51. typedef __int16 ogg_int16_t;
  52. typedef unsigned __int16 ogg_uint16_t;
  53. # endif
  54. #elif defined(__MACOS__)
  55. # include <sys/types.h>
  56. typedef SInt16 ogg_int16_t;
  57. typedef UInt16 ogg_uint16_t;
  58. typedef SInt32 ogg_int32_t;
  59. typedef UInt32 ogg_uint32_t;
  60. typedef SInt64 ogg_int64_t;
  61. #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
  62. # include <inttypes.h>
  63. typedef int16_t ogg_int16_t;
  64. typedef uint16_t ogg_uint16_t;
  65. typedef int32_t ogg_int32_t;
  66. typedef uint32_t ogg_uint32_t;
  67. typedef int64_t ogg_int64_t;
  68. #elif defined(__HAIKU__)
  69. /* Haiku */
  70. # include <sys/types.h>
  71. typedef short ogg_int16_t;
  72. typedef unsigned short ogg_uint16_t;
  73. typedef int ogg_int32_t;
  74. typedef unsigned int ogg_uint32_t;
  75. typedef long long ogg_int64_t;
  76. #elif defined(__BEOS__)
  77. /* Be */
  78. # include <inttypes.h>
  79. typedef int16_t ogg_int16_t;
  80. typedef uint16_t ogg_uint16_t;
  81. typedef int32_t ogg_int32_t;
  82. typedef uint32_t ogg_uint32_t;
  83. typedef int64_t ogg_int64_t;
  84. #elif defined (__EMX__)
  85. /* OS/2 GCC */
  86. typedef short ogg_int16_t;
  87. typedef unsigned short ogg_uint16_t;
  88. typedef int ogg_int32_t;
  89. typedef unsigned int ogg_uint32_t;
  90. typedef long long ogg_int64_t;
  91. #elif defined (DJGPP)
  92. /* DJGPP */
  93. typedef short ogg_int16_t;
  94. typedef int ogg_int32_t;
  95. typedef unsigned int ogg_uint32_t;
  96. typedef long long ogg_int64_t;
  97. #elif defined(R5900)
  98. /* PS2 EE */
  99. typedef long ogg_int64_t;
  100. typedef int ogg_int32_t;
  101. typedef unsigned ogg_uint32_t;
  102. typedef short ogg_int16_t;
  103. #elif defined(__SYMBIAN32__)
  104. /* Symbian GCC */
  105. typedef signed short ogg_int16_t;
  106. typedef unsigned short ogg_uint16_t;
  107. typedef signed int ogg_int32_t;
  108. typedef unsigned int ogg_uint32_t;
  109. typedef long long int ogg_int64_t;
  110. #elif defined(__TMS320C6X__)
  111. /* TI C64x compiler */
  112. typedef signed short ogg_int16_t;
  113. typedef unsigned short ogg_uint16_t;
  114. typedef signed int ogg_int32_t;
  115. typedef unsigned int ogg_uint32_t;
  116. typedef long long int ogg_int64_t;
  117. #else
  118. # include <ogg/config_types.h>
  119. #endif
  120. #endif /* _OS_TYPES_H */