_fake_defines.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. #ifndef _FAKE_DEFINES_H
  2. #define _FAKE_DEFINES_H
  3. #define NULL 0
  4. #define BUFSIZ 1024
  5. #define FOPEN_MAX 20
  6. #define FILENAME_MAX 1024
  7. #ifndef SEEK_SET
  8. #define SEEK_SET 0 /* set file offset to offset */
  9. #endif
  10. #ifndef SEEK_CUR
  11. #define SEEK_CUR 1 /* set file offset to current plus offset */
  12. #endif
  13. #ifndef SEEK_END
  14. #define SEEK_END 2 /* set file offset to EOF plus offset */
  15. #endif
  16. #define __LITTLE_ENDIAN 1234
  17. #define LITTLE_ENDIAN __LITTLE_ENDIAN
  18. #define __BIG_ENDIAN 4321
  19. #define BIG_ENDIAN __BIG_ENDIAN
  20. #define __BYTE_ORDER __LITTLE_ENDIAN
  21. #define BYTE_ORDER __BYTE_ORDER
  22. #define EXIT_FAILURE 1
  23. #define EXIT_SUCCESS 0
  24. #define UCHAR_MAX 255
  25. #define USHRT_MAX 65535
  26. #define UINT_MAX 4294967295U
  27. #define RAND_MAX 32767
  28. #define INT_MAX 32767
  29. /* C99 inttypes.h defines */
  30. #define PRId8 "d"
  31. #define PRIi8 "i"
  32. #define PRIo8 "o"
  33. #define PRIu8 "u"
  34. #define PRIx8 "x"
  35. #define PRIX8 "X"
  36. #define PRId16 "d"
  37. #define PRIi16 "i"
  38. #define PRIo16 "o"
  39. #define PRIu16 "u"
  40. #define PRIx16 "x"
  41. #define PRIX16 "X"
  42. #define PRId32 "d"
  43. #define PRIi32 "i"
  44. #define PRIo32 "o"
  45. #define PRIu32 "u"
  46. #define PRIx32 "x"
  47. #define PRIX32 "X"
  48. #define PRId64 "d"
  49. #define PRIi64 "i"
  50. #define PRIo64 "o"
  51. #define PRIu64 "u"
  52. #define PRIx64 "x"
  53. #define PRIX64 "X"
  54. #define PRIdLEAST8 "d"
  55. #define PRIiLEAST8 "i"
  56. #define PRIoLEAST8 "o"
  57. #define PRIuLEAST8 "u"
  58. #define PRIxLEAST8 "x"
  59. #define PRIXLEAST8 "X"
  60. #define PRIdLEAST16 "d"
  61. #define PRIiLEAST16 "i"
  62. #define PRIoLEAST16 "o"
  63. #define PRIuLEAST16 "u"
  64. #define PRIxLEAST16 "x"
  65. #define PRIXLEAST16 "X"
  66. #define PRIdLEAST32 "d"
  67. #define PRIiLEAST32 "i"
  68. #define PRIoLEAST32 "o"
  69. #define PRIuLEAST32 "u"
  70. #define PRIxLEAST32 "x"
  71. #define PRIXLEAST32 "X"
  72. #define PRIdLEAST64 "d"
  73. #define PRIiLEAST64 "i"
  74. #define PRIoLEAST64 "o"
  75. #define PRIuLEAST64 "u"
  76. #define PRIxLEAST64 "x"
  77. #define PRIXLEAST64 "X"
  78. #define PRIdFAST8 "d"
  79. #define PRIiFAST8 "i"
  80. #define PRIoFAST8 "o"
  81. #define PRIuFAST8 "u"
  82. #define PRIxFAST8 "x"
  83. #define PRIXFAST8 "X"
  84. #define PRIdFAST16 "d"
  85. #define PRIiFAST16 "i"
  86. #define PRIoFAST16 "o"
  87. #define PRIuFAST16 "u"
  88. #define PRIxFAST16 "x"
  89. #define PRIXFAST16 "X"
  90. #define PRIdFAST32 "d"
  91. #define PRIiFAST32 "i"
  92. #define PRIoFAST32 "o"
  93. #define PRIuFAST32 "u"
  94. #define PRIxFAST32 "x"
  95. #define PRIXFAST32 "X"
  96. #define PRIdFAST64 "d"
  97. #define PRIiFAST64 "i"
  98. #define PRIoFAST64 "o"
  99. #define PRIuFAST64 "u"
  100. #define PRIxFAST64 "x"
  101. #define PRIXFAST64 "X"
  102. #define PRIdPTR "d"
  103. #define PRIiPTR "i"
  104. #define PRIoPTR "o"
  105. #define PRIuPTR "u"
  106. #define PRIxPTR "x"
  107. #define PRIXPTR "X"
  108. #define PRIdMAX "d"
  109. #define PRIiMAX "i"
  110. #define PRIoMAX "o"
  111. #define PRIuMAX "u"
  112. #define PRIxMAX "x"
  113. #define PRIXMAX "X"
  114. #define SCNd8 "d"
  115. #define SCNi8 "i"
  116. #define SCNo8 "o"
  117. #define SCNu8 "u"
  118. #define SCNx8 "x"
  119. #define SCNd16 "d"
  120. #define SCNi16 "i"
  121. #define SCNo16 "o"
  122. #define SCNu16 "u"
  123. #define SCNx16 "x"
  124. #define SCNd32 "d"
  125. #define SCNi32 "i"
  126. #define SCNo32 "o"
  127. #define SCNu32 "u"
  128. #define SCNx32 "x"
  129. #define SCNd64 "d"
  130. #define SCNi64 "i"
  131. #define SCNo64 "o"
  132. #define SCNu64 "u"
  133. #define SCNx64 "x"
  134. #define SCNdLEAST8 "d"
  135. #define SCNiLEAST8 "i"
  136. #define SCNoLEAST8 "o"
  137. #define SCNuLEAST8 "u"
  138. #define SCNxLEAST8 "x"
  139. #define SCNdLEAST16 "d"
  140. #define SCNiLEAST16 "i"
  141. #define SCNoLEAST16 "o"
  142. #define SCNuLEAST16 "u"
  143. #define SCNxLEAST16 "x"
  144. #define SCNdLEAST32 "d"
  145. #define SCNiLEAST32 "i"
  146. #define SCNoLEAST32 "o"
  147. #define SCNuLEAST32 "u"
  148. #define SCNxLEAST32 "x"
  149. #define SCNdLEAST64 "d"
  150. #define SCNiLEAST64 "i"
  151. #define SCNoLEAST64 "o"
  152. #define SCNuLEAST64 "u"
  153. #define SCNxLEAST64 "x"
  154. #define SCNdFAST8 "d"
  155. #define SCNiFAST8 "i"
  156. #define SCNoFAST8 "o"
  157. #define SCNuFAST8 "u"
  158. #define SCNxFAST8 "x"
  159. #define SCNdFAST16 "d"
  160. #define SCNiFAST16 "i"
  161. #define SCNoFAST16 "o"
  162. #define SCNuFAST16 "u"
  163. #define SCNxFAST16 "x"
  164. #define SCNdFAST32 "d"
  165. #define SCNiFAST32 "i"
  166. #define SCNoFAST32 "o"
  167. #define SCNuFAST32 "u"
  168. #define SCNxFAST32 "x"
  169. #define SCNdFAST64 "d"
  170. #define SCNiFAST64 "i"
  171. #define SCNoFAST64 "o"
  172. #define SCNuFAST64 "u"
  173. #define SCNxFAST64 "x"
  174. #define SCNdPTR "d"
  175. #define SCNiPTR "i"
  176. #define SCNoPTR "o"
  177. #define SCNuPTR "u"
  178. #define SCNxPTR "x"
  179. #define SCNdMAX "d"
  180. #define SCNiMAX "i"
  181. #define SCNoMAX "o"
  182. #define SCNuMAX "u"
  183. #define SCNxMAX "x"
  184. /* C99 stdbool.h defines */
  185. #define __bool_true_false_are_defined 1
  186. #define false 0
  187. #define true 1
  188. /* va_arg macros and type*/
  189. #define va_start(_ap, _type) __builtin_va_start((_ap))
  190. #define va_arg(_ap, _type) __builtin_va_arg((_ap))
  191. #define va_end(_list)
  192. #endif