wm_type_def.h 2.5 KB

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