pv_audio_type_defs.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /* ------------------------------------------------------------------
  2. * Copyright (C) 1998-2009 PacketVideo
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  13. * express or implied.
  14. * See the License for the specific language governing permissions
  15. * and limitations under the License.
  16. * -------------------------------------------------------------------
  17. */
  18. /*
  19. ------------------------------------------------------------------------------
  20. Filename: pv_audio_type_defs.h
  21. ------------------------------------------------------------------------------
  22. INCLUDE DESCRIPTION
  23. This file was derived from a number of standards bodies. The type
  24. definitions below were created from some of the best practices observed
  25. in the standards bodies.
  26. This file is dependent on limits.h for defining the bit widths. In an
  27. ANSI C environment limits.h is expected to always be present and contain
  28. the following definitions:
  29. SCHAR_MIN
  30. SCHAR_MAX
  31. UCHAR_MAX
  32. INT_MAX
  33. INT_MIN
  34. UINT_MAX
  35. SHRT_MIN
  36. SHRT_MAX
  37. USHRT_MAX
  38. LONG_MIN
  39. LONG_MAX
  40. ULONG_MAX
  41. ------------------------------------------------------------------------------
  42. */
  43. #ifndef PV_AUDIO_TYPE_DEFS_H
  44. #define PV_AUDIO_TYPE_DEFS_H
  45. #include <inttypes.h>
  46. #ifndef Char
  47. typedef int8_t Char;
  48. #endif
  49. #ifndef Int8
  50. typedef int8_t Int8;
  51. #endif
  52. #ifndef UChar
  53. typedef uint8_t UChar;
  54. #endif
  55. #ifndef UInt8
  56. typedef uint8_t UInt8;
  57. #endif
  58. /*----------------------------------------------------------------------------
  59. ; Define generic signed and unsigned int
  60. ----------------------------------------------------------------------------*/
  61. #ifndef Int
  62. typedef signed int Int;
  63. #endif
  64. #ifndef UInt
  65. typedef unsigned int UInt;
  66. #endif
  67. /*----------------------------------------------------------------------------
  68. ; Define 16 bit signed and unsigned words
  69. ----------------------------------------------------------------------------*/
  70. #ifndef Int16
  71. typedef int16_t Int16;
  72. #endif
  73. #ifndef INT16_MIN
  74. #define INT16_MIN (-32768)
  75. #endif
  76. #ifndef INT16_MAX
  77. #define INT16_MAX 32767
  78. #endif
  79. #ifndef UInt16
  80. typedef uint16_t UInt16;
  81. #endif
  82. /*----------------------------------------------------------------------------
  83. ; Define 32 bit signed and unsigned words
  84. ----------------------------------------------------------------------------*/
  85. #ifndef Int32
  86. typedef int32_t Int32;
  87. #endif
  88. #ifndef INT32_MIN
  89. #define INT32_MIN (-2147483647 - 1)
  90. #endif
  91. #ifndef INT32_MAX
  92. #define INT32_MAX 2147483647
  93. #endif
  94. #ifndef UInt32
  95. typedef uint32_t UInt32;
  96. #endif
  97. #ifndef UINT32_MIN
  98. #define UINT32_MIN 0
  99. #endif
  100. #ifndef UINT32_MAX
  101. #define UINT32_MAX 0xffffffff
  102. #endif
  103. #ifndef INT_MAX
  104. #define INT_MAX INT32_MAX /* for 32 bit */
  105. #endif
  106. /*----------------------------------------------------------------------------
  107. ; Define 64 bit signed and unsigned words
  108. ----------------------------------------------------------------------------*/
  109. #ifndef Int64
  110. typedef int64_t Int64;
  111. #endif
  112. #ifndef UInt64
  113. typedef uint64_t UInt64;
  114. #endif
  115. /*----------------------------------------------------------------------------
  116. ; Define boolean type
  117. ----------------------------------------------------------------------------*/
  118. #ifndef Bool
  119. typedef Int Bool;
  120. #endif
  121. #ifndef FALSE
  122. #define FALSE 0
  123. #endif
  124. #ifndef TRUE
  125. #define TRUE 1
  126. #endif
  127. #ifndef OFF
  128. #define OFF 0
  129. #endif
  130. #ifndef ON
  131. #define ON 1
  132. #endif
  133. #ifndef NO
  134. #define NO 0
  135. #endif
  136. #ifndef YES
  137. #define YES 1
  138. #endif
  139. #ifndef SUCCESS
  140. #define SUCCESS 0
  141. #endif
  142. #ifndef NULL
  143. #define NULL 0
  144. #endif
  145. #ifndef OSCL_IMPORT_REF
  146. #define OSCL_IMPORT_REF
  147. #endif
  148. #ifndef OSCL_EXPORT_REF
  149. #define OSCL_EXPORT_REF
  150. #endif
  151. #ifndef OSCL_IMPORT_REF
  152. #define OSCL_IMPORT_REF
  153. #endif
  154. #ifndef OSCL_UNUSED_ARG
  155. #define OSCL_UNUSED_ARG(x) (void)(x)
  156. #endif
  157. #endif /* PV_AUDIO_TYPE_DEFS_H */