wm_type_def.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /**
  2. * @file wm_type_def.h
  3. *
  4. * @brief WM type redefine
  5. *
  6. * @author winnermicro
  7. *
  8. * Copyright (c) 2015 Winner Microelectronics Co., Ltd.
  9. */
  10. #ifndef __WM_TYPE_DEF_H__
  11. #define __WM_TYPE_DEF_H__
  12. #ifdef bool
  13. #undef bool
  14. #endif
  15. #ifdef u8
  16. #undef u8
  17. #endif
  18. #ifdef s8
  19. #undef s8
  20. #endif
  21. #ifdef u16
  22. #undef u16
  23. #endif
  24. #ifdef s16
  25. #undef s16
  26. #endif
  27. #ifdef u32
  28. #undef u32
  29. #endif
  30. #ifdef s32
  31. #undef s32
  32. #endif
  33. #ifdef u64
  34. #undef u64
  35. #endif
  36. #ifdef s64
  37. #undef s64
  38. #endif
  39. #ifdef u_char
  40. #undef u_char
  41. #endif
  42. typedef unsigned char u_char;
  43. #ifdef INT8U
  44. #undef INT8U
  45. #endif
  46. typedef unsigned char INT8U;
  47. #ifdef INT8S
  48. #undef INT8S
  49. #endif
  50. typedef signed char INT8S;
  51. typedef unsigned char bool;
  52. typedef unsigned char u8;
  53. typedef signed char s8;
  54. typedef unsigned short u16;
  55. typedef signed short s16;
  56. typedef unsigned int u32;
  57. typedef signed int s32;
  58. typedef unsigned long long u64;
  59. typedef long long s64;
  60. #if defined(_NEWLIB_VERSION_H__)
  61. #ifdef int32_t
  62. #undef int32_t
  63. typedef int int32_t;
  64. #endif
  65. #ifdef uint32_t
  66. #undef uint32_t
  67. typedef unsigned int uint32_t;
  68. #endif
  69. #endif
  70. #if defined(__MINILIBC__)
  71. typedef int int32_t;
  72. typedef unsigned int uint32_t;
  73. #endif
  74. #ifdef int32
  75. #undef int32
  76. #endif
  77. typedef int int32;
  78. #ifdef uint32
  79. #undef uint32
  80. #endif
  81. typedef unsigned int uint32;
  82. #ifdef int16
  83. #undef int16
  84. #endif
  85. typedef short int16;
  86. #ifdef uint16
  87. #undef uint16
  88. #endif
  89. typedef unsigned short uint16;
  90. #ifdef ULONG
  91. #undef ULONG
  92. #endif
  93. typedef unsigned long ULONG;
  94. #ifdef u8_t
  95. #undef u8_t
  96. #endif
  97. typedef unsigned char u8_t;
  98. #ifdef uint8_t
  99. #undef uint8_t
  100. #endif
  101. typedef unsigned char uint8_t;
  102. #ifdef u16_t
  103. #undef u16_t
  104. #endif
  105. typedef unsigned short u16_t;
  106. #ifdef uint16_t
  107. #undef uint16_t
  108. #endif
  109. typedef unsigned short uint16_t;
  110. #ifdef u32_t
  111. #undef u32_t
  112. #endif
  113. typedef unsigned int u32_t;
  114. #ifdef s8_t
  115. #undef s8_t
  116. #endif
  117. typedef signed char s8_t;
  118. #ifdef s16_t
  119. #undef s16_t
  120. #endif
  121. typedef signed short s16_t;
  122. #ifdef s32_t
  123. #undef s32_t
  124. #endif
  125. typedef signed int s32_t;
  126. #if (GCC_COMPILE==0)
  127. #ifdef size_t
  128. #undef size_t
  129. #endif
  130. typedef unsigned int size_t;
  131. #endif
  132. #ifdef err_t
  133. #undef err_t
  134. #endif
  135. typedef signed char err_t;
  136. #ifdef mem_ptr_t
  137. #undef mem_ptr_t
  138. #endif
  139. typedef unsigned int mem_ptr_t;
  140. #ifdef TRUE
  141. #undef TRUE
  142. #endif
  143. #define TRUE 1
  144. #ifdef FALSE
  145. #undef FALSE
  146. #endif
  147. #define FALSE 0
  148. #define true 1
  149. #define false 0
  150. #define WM_SUCCESS 0
  151. #define WM_FAILED -1
  152. #ifndef IGNORE_PARAMETER
  153. #define IGNORE_PARAMETER(x) ((x) = (x))
  154. #endif
  155. #endif