_mingw.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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 __declspec(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 static __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. #else
  69. #define __stdcall __attribute__((__stdcall__))
  70. #define _X86_ 1
  71. #define _M_IX86 300 /* Visual Studio */
  72. #ifndef __MINGW_USE_VC2005_COMPAT /* time became 64, but not timeval.tv_sec */
  73. # ifndef _USE_32BIT_TIME_T
  74. # define _USE_32BIT_TIME_T
  75. # endif
  76. #endif
  77. #endif
  78. /* in stddef.h */
  79. #define _SIZE_T_DEFINED
  80. #define _SSIZE_T_DEFINED
  81. #define _PTRDIFF_T_DEFINED
  82. #define _WCHAR_T_DEFINED
  83. #define _UINTPTR_T_DEFINED
  84. #define _INTPTR_T_DEFINED
  85. #define _INTEGRAL_MAX_BITS 64
  86. #ifndef _TIME32_T_DEFINED
  87. #define _TIME32_T_DEFINED
  88. typedef long __time32_t;
  89. #endif
  90. #ifndef _TIME64_T_DEFINED
  91. #define _TIME64_T_DEFINED
  92. typedef long long __time64_t;
  93. #endif
  94. #ifndef _TIME_T_DEFINED
  95. #define _TIME_T_DEFINED
  96. #ifdef _USE_32BIT_TIME_T
  97. typedef __time32_t time_t;
  98. #else
  99. typedef __time64_t time_t;
  100. #endif
  101. #endif
  102. #ifndef _WCTYPE_T_DEFINED
  103. #define _WCTYPE_T_DEFINED
  104. typedef wchar_t wctype_t;
  105. #endif
  106. #ifndef _WINT_T
  107. #define _WINT_T
  108. typedef __WINT_TYPE__ wint_t;
  109. #endif
  110. typedef int errno_t;
  111. #define _ERRCODE_DEFINED
  112. typedef struct threadlocaleinfostruct *pthreadlocinfo;
  113. typedef struct threadmbcinfostruct *pthreadmbcinfo;
  114. typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
  115. /* for winapi */
  116. #define _ANONYMOUS_UNION
  117. #define _ANONYMOUS_STRUCT
  118. #define DECLSPEC_NORETURN __declspec(noreturn)
  119. #define DECLARE_STDCALL_P(type) __stdcall type
  120. #define NOSERVICE 1
  121. #define NOMCX 1
  122. #define NOIME 1
  123. #define __INTRIN_H_
  124. #ifndef DUMMYUNIONNAME
  125. # define DUMMYUNIONNAME
  126. # define DUMMYUNIONNAME1
  127. # define DUMMYUNIONNAME2
  128. # define DUMMYUNIONNAME3
  129. # define DUMMYUNIONNAME4
  130. # define DUMMYUNIONNAME5
  131. #endif
  132. #ifndef DUMMYSTRUCTNAME
  133. # define DUMMYSTRUCTNAME
  134. #endif
  135. #ifndef WINVER
  136. # define WINVER 0x0502
  137. #endif
  138. #ifndef _WIN32_WINNT
  139. # define _WIN32_WINNT 0x502
  140. #endif
  141. #define __C89_NAMELESS
  142. #define __MINGW_EXTENSION
  143. #define WINAPI_FAMILY_PARTITION(X) 1
  144. #define MINGW_HAS_SECURE_API
  145. #define WIN32 1
  146. #endif /* __MINGW_H */