_mingw.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * _mingw.h
  3. *
  4. * This file is for TinyCC and not part of the Mingw32 package.
  5. *
  6. * THIS SOFTWARE IS NOT COPYRIGHTED
  7. *
  8. * This source code is offered for use in the public domain. You may
  9. * use, modify or distribute it freely.
  10. *
  11. * This code is distributed in the hope that it will be useful but
  12. * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  13. * DISCLAIMED. This includes but is not limited to warranties of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. */
  17. #ifndef __MINGW_H
  18. #define __MINGW_H
  19. /* some winapi files define these before including _mingw.h --> */
  20. #undef __cdecl
  21. #undef _X86_
  22. #undef WIN32
  23. /* <-- */
  24. #include <stddef.h>
  25. #include <stdarg.h>
  26. #define __int8 char
  27. #define __int16 short
  28. #define __int32 int
  29. #define __int64 long long
  30. #define _HAVE_INT64
  31. #define __cdecl
  32. #define __declspec(x) __attribute__((x))
  33. #define __unaligned __attribute__((packed))
  34. #define __fastcall __attribute__((fastcall))
  35. #define __MSVCRT__ 1
  36. #undef _MSVCRT_
  37. #define __MINGW_IMPORT extern __declspec(dllimport)
  38. #define __MINGW_ATTRIB_NORETURN
  39. #define __MINGW_ATTRIB_CONST
  40. #define __MINGW_ATTRIB_DEPRECATED
  41. #define __MINGW_ATTRIB_MALLOC
  42. #define __MINGW_ATTRIB_PURE
  43. #define __MINGW_ATTRIB_NONNULL(arg)
  44. #define __MINGW_NOTHROW
  45. #define __GNUC_VA_LIST
  46. #define _CRTIMP extern
  47. #define __CRT_INLINE extern __inline__
  48. #define _CRT_ALIGN(x) __attribute__((aligned(x)))
  49. #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
  50. #define _CRT_PACKING 8
  51. #define __CRT_UNALIGNED
  52. #define _CONST_RETURN
  53. #ifndef _TRUNCATE
  54. #define _TRUNCATE ((size_t)-1)
  55. #endif
  56. #define __CRT_STRINGIZE(_Value) #_Value
  57. #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
  58. #define __CRT_WIDE(_String) L ## _String
  59. #define _CRT_WIDE(_String) __CRT_WIDE(_String)
  60. #ifdef _WIN64
  61. #define __stdcall
  62. #define _AMD64_ 1
  63. #define __x86_64 1
  64. #define _M_X64 100 /* Visual Studio */
  65. #define _M_AMD64 100 /* Visual Studio */
  66. #define USE_MINGW_SETJMP_TWO_ARGS
  67. #define mingw_getsp tinyc_getbp
  68. #define __TRY__
  69. #else
  70. #define __stdcall __attribute__((__stdcall__))
  71. #define _X86_ 1
  72. #define _M_IX86 300 /* Visual Studio */
  73. #define WIN32 1
  74. #define _USE_32BIT_TIME_T
  75. #ifdef __arm__
  76. #define __TRY__
  77. #else
  78. #define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec);
  79. #endif
  80. #endif
  81. /* in stddef.h */
  82. #define _SIZE_T_DEFINED
  83. #define _SSIZE_T_DEFINED
  84. #define _PTRDIFF_T_DEFINED
  85. #define _WCHAR_T_DEFINED
  86. #define _UINTPTR_T_DEFINED
  87. #define _INTPTR_T_DEFINED
  88. #define _INTEGRAL_MAX_BITS 64
  89. #ifndef _TIME32_T_DEFINED
  90. #define _TIME32_T_DEFINED
  91. typedef long __time32_t;
  92. #endif
  93. #ifndef _TIME64_T_DEFINED
  94. #define _TIME64_T_DEFINED
  95. typedef long long __time64_t;
  96. #endif
  97. #ifndef _TIME_T_DEFINED
  98. #define _TIME_T_DEFINED
  99. #ifdef _USE_32BIT_TIME_T
  100. typedef __time32_t time_t;
  101. #else
  102. typedef __time64_t time_t;
  103. #endif
  104. #endif
  105. #ifndef _WCTYPE_T_DEFINED
  106. #define _WCTYPE_T_DEFINED
  107. typedef wchar_t wctype_t;
  108. #endif
  109. #ifndef _WINT_T
  110. #define _WINT_T
  111. typedef __WINT_TYPE__ wint_t;
  112. #endif
  113. typedef int errno_t;
  114. #define _ERRCODE_DEFINED
  115. typedef struct threadlocaleinfostruct *pthreadlocinfo;
  116. typedef struct threadmbcinfostruct *pthreadmbcinfo;
  117. typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
  118. /* for winapi */
  119. #define _ANONYMOUS_UNION
  120. #define _ANONYMOUS_STRUCT
  121. #define DECLSPEC_NORETURN
  122. #define DECLARE_STDCALL_P(type) __stdcall type
  123. #define NOSERVICE 1
  124. #define NOMCX 1
  125. #define NOIME 1
  126. #define __INTRIN_H_
  127. #ifndef DUMMYUNIONNAME
  128. # define DUMMYUNIONNAME
  129. # define DUMMYUNIONNAME1
  130. # define DUMMYUNIONNAME2
  131. # define DUMMYUNIONNAME3
  132. # define DUMMYUNIONNAME4
  133. # define DUMMYUNIONNAME5
  134. #endif
  135. #ifndef DUMMYSTRUCTNAME
  136. # define DUMMYSTRUCTNAME
  137. #endif
  138. #ifndef WINVER
  139. # define WINVER 0x0502
  140. #endif
  141. #ifndef _WIN32_WINNT
  142. # define _WIN32_WINNT 0x502
  143. #endif
  144. #define __C89_NAMELESS
  145. #define __MINGW_EXTENSION
  146. #define WINAPI_FAMILY_PARTITION(X) 1
  147. #define MINGW_HAS_SECURE_API
  148. #endif /* __MINGW_H */