os_types.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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: Define a consistent set of types on each platform.
  13. ********************************************************************/
  14. #ifndef _OS_TYPES_H
  15. #define _OS_TYPES_H
  16. /* make it easy on the folks that want to compile the libs with a
  17. different malloc than stdlib */
  18. #define _ogg_malloc malloc
  19. #define _ogg_calloc calloc
  20. #define _ogg_realloc realloc
  21. #define _ogg_free free
  22. #if defined(_WIN32)
  23. # if defined(__CYGWIN__)
  24. # include <stdint.h>
  25. typedef int16_t ogg_int16_t;
  26. typedef uint16_t ogg_uint16_t;
  27. typedef int32_t ogg_int32_t;
  28. typedef uint32_t ogg_uint32_t;
  29. typedef int64_t ogg_int64_t;
  30. typedef uint64_t ogg_uint64_t;
  31. # elif defined(__MINGW32__)
  32. # include <sys/types.h>
  33. typedef short ogg_int16_t;
  34. typedef unsigned short ogg_uint16_t;
  35. typedef int ogg_int32_t;
  36. typedef unsigned int ogg_uint32_t;
  37. typedef long long ogg_int64_t;
  38. typedef unsigned long long ogg_uint64_t;
  39. # elif defined(__MWERKS__)
  40. typedef long long ogg_int64_t;
  41. typedef unsigned long long ogg_uint64_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. # if defined(_MSC_VER) && (_MSC_VER >= 1800) /* MSVC 2013 and newer */
  48. # include <stdint.h>
  49. typedef int16_t ogg_int16_t;
  50. typedef uint16_t ogg_uint16_t;
  51. typedef int32_t ogg_int32_t;
  52. typedef uint32_t ogg_uint32_t;
  53. typedef int64_t ogg_int64_t;
  54. typedef uint64_t ogg_uint64_t;
  55. # else
  56. /* MSVC/Borland */
  57. typedef __int64 ogg_int64_t;
  58. typedef __int32 ogg_int32_t;
  59. typedef unsigned __int32 ogg_uint32_t;
  60. typedef unsigned __int64 ogg_uint64_t;
  61. typedef __int16 ogg_int16_t;
  62. typedef unsigned __int16 ogg_uint16_t;
  63. # endif
  64. # endif
  65. #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
  66. # include <sys/types.h>
  67. typedef int16_t ogg_int16_t;
  68. typedef u_int16_t ogg_uint16_t;
  69. typedef int32_t ogg_int32_t;
  70. typedef u_int32_t ogg_uint32_t;
  71. typedef int64_t ogg_int64_t;
  72. typedef u_int64_t ogg_uint64_t;
  73. #elif defined(__HAIKU__)
  74. /* Haiku */
  75. # include <sys/types.h>
  76. typedef short ogg_int16_t;
  77. typedef unsigned short ogg_uint16_t;
  78. typedef int ogg_int32_t;
  79. typedef unsigned int ogg_uint32_t;
  80. typedef long long ogg_int64_t;
  81. typedef unsigned long long ogg_uint64_t;
  82. #elif defined(__BEOS__)
  83. /* Be */
  84. # include <inttypes.h>
  85. typedef int16_t ogg_int16_t;
  86. typedef uint16_t ogg_uint16_t;
  87. typedef int32_t ogg_int32_t;
  88. typedef uint32_t ogg_uint32_t;
  89. typedef int64_t ogg_int64_t;
  90. typedef uint64_t ogg_uint64_t;
  91. #elif defined (__EMX__)
  92. /* OS/2 GCC */
  93. typedef short ogg_int16_t;
  94. typedef unsigned short ogg_uint16_t;
  95. typedef int ogg_int32_t;
  96. typedef unsigned int ogg_uint32_t;
  97. typedef long long ogg_int64_t;
  98. typedef unsigned long long ogg_uint64_t;
  99. #elif defined (DJGPP)
  100. /* DJGPP */
  101. typedef short ogg_int16_t;
  102. typedef int ogg_int32_t;
  103. typedef unsigned int ogg_uint32_t;
  104. typedef long long ogg_int64_t;
  105. typedef unsigned long long ogg_uint64_t;
  106. #elif defined(R5900)
  107. /* PS2 EE */
  108. typedef long ogg_int64_t;
  109. typedef unsigned long ogg_uint64_t;
  110. typedef int ogg_int32_t;
  111. typedef unsigned ogg_uint32_t;
  112. typedef short ogg_int16_t;
  113. #elif defined(__SYMBIAN32__)
  114. /* Symbian GCC */
  115. typedef signed short ogg_int16_t;
  116. typedef unsigned short ogg_uint16_t;
  117. typedef signed int ogg_int32_t;
  118. typedef unsigned int ogg_uint32_t;
  119. typedef long long int ogg_int64_t;
  120. typedef unsigned long long int ogg_uint64_t;
  121. #elif defined(__TMS320C6X__)
  122. /* TI C64x compiler */
  123. typedef signed short ogg_int16_t;
  124. typedef unsigned short ogg_uint16_t;
  125. typedef signed int ogg_int32_t;
  126. typedef unsigned int ogg_uint32_t;
  127. typedef long long int ogg_int64_t;
  128. typedef unsigned long long int ogg_uint64_t;
  129. #else
  130. # include <ogg/config_types.h>
  131. #endif
  132. #endif /* _OS_TYPES_H */