os_types.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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$
  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. # 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 __int16 ogg_int16_t;
  61. typedef unsigned __int16 ogg_uint16_t;
  62. # endif
  63. # endif
  64. #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
  65. # include <inttypes.h>
  66. typedef int16_t ogg_int16_t;
  67. typedef uint16_t ogg_uint16_t;
  68. typedef int32_t ogg_int32_t;
  69. typedef uint32_t ogg_uint32_t;
  70. typedef int64_t ogg_int64_t;
  71. #elif defined(__HAIKU__)
  72. /* Haiku */
  73. # include <sys/types.h>
  74. typedef short ogg_int16_t;
  75. typedef unsigned short ogg_uint16_t;
  76. typedef int ogg_int32_t;
  77. typedef unsigned int ogg_uint32_t;
  78. typedef long long ogg_int64_t;
  79. #elif defined(__BEOS__)
  80. /* Be */
  81. # include <inttypes.h>
  82. typedef int16_t ogg_int16_t;
  83. typedef uint16_t ogg_uint16_t;
  84. typedef int32_t ogg_int32_t;
  85. typedef uint32_t ogg_uint32_t;
  86. typedef int64_t ogg_int64_t;
  87. #elif defined (__EMX__)
  88. /* OS/2 GCC */
  89. typedef short ogg_int16_t;
  90. typedef unsigned short ogg_uint16_t;
  91. typedef int ogg_int32_t;
  92. typedef unsigned int ogg_uint32_t;
  93. typedef long long ogg_int64_t;
  94. #elif defined (DJGPP)
  95. /* DJGPP */
  96. typedef short ogg_int16_t;
  97. typedef int ogg_int32_t;
  98. typedef unsigned int ogg_uint32_t;
  99. typedef long long ogg_int64_t;
  100. #elif defined(R5900)
  101. /* PS2 EE */
  102. typedef long ogg_int64_t;
  103. typedef int ogg_int32_t;
  104. typedef unsigned ogg_uint32_t;
  105. typedef short ogg_int16_t;
  106. #elif defined(__SYMBIAN32__)
  107. /* Symbian GCC */
  108. typedef signed short ogg_int16_t;
  109. typedef unsigned short ogg_uint16_t;
  110. typedef signed int ogg_int32_t;
  111. typedef unsigned int ogg_uint32_t;
  112. typedef long long int ogg_int64_t;
  113. #elif defined(__TMS320C6X__)
  114. /* TI C64x compiler */
  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. #else
  121. # include <ogg/config_types.h>
  122. #endif
  123. #endif /* _OS_TYPES_H */