Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  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.  
  18. #ifndef __MINGW_H
  19. #define __MINGW_H
  20.  
  21. /* some winapi files define these before including _mingw.h --> */
  22. #undef __cdecl
  23. #undef _X86_
  24. #undef WIN32
  25. /* <-- */
  26.  
  27. #include <stddef.h>
  28. #include <stdarg.h>
  29.  
  30. #define __int8 char
  31. #define __int16 short
  32. #define __int32 int
  33. #define __int64 long long
  34.  
  35. #define __cdecl __attribute__((__cdecl__))
  36. #define __declspec(x) __attribute__((x))
  37. #define __unaligned __attribute__((packed))
  38. #define __fastcall __attribute__((fastcall))
  39.  
  40. #define __MSVCRT__ 1
  41. #undef _MSVCRT_
  42. #define __MINGW_IMPORT extern __declspec(dllimport)
  43. #define __MINGW_ATTRIB_NORETURN
  44. #define __MINGW_ATTRIB_CONST
  45. #define __MINGW_ATTRIB_DEPRECATED
  46. #define __MINGW_ATTRIB_MALLOC
  47. #define __MINGW_ATTRIB_PURE
  48. #define __MINGW_ATTRIB_NONNULL(arg)
  49. #define __MINGW_NOTHROW
  50. #define __GNUC_VA_LIST
  51.  
  52. #define _CRTIMP extern
  53. #define __CRT_INLINE extern __inline__
  54.  
  55. #define _CRT_ALIGN(x) __attribute__((aligned(x)))
  56. #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
  57. #define _CRT_PACKING 8
  58. #define __CRT_UNALIGNED
  59. #define _CONST_RETURN
  60.  
  61. #define __CRT_STRINGIZE(_Value) #_Value
  62. #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
  63. #define __CRT_WIDE(_String) L ## _String
  64. #define _CRT_WIDE(_String) __CRT_WIDE(_String)
  65.  
  66. #ifdef _WIN64
  67. #define __stdcall
  68. #define _AMD64_ 1
  69. #define __x86_64 1
  70. #define USE_MINGW_SETJMP_TWO_ARGS
  71. #define mingw_getsp tinyc_getbp
  72. #define __TRY__
  73. #else
  74. #define __stdcall __attribute__((__stdcall__))
  75. #define _X86_ 1
  76. #define WIN32 1
  77. #define _USE_32BIT_TIME_T
  78. #define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec);
  79. #endif
  80.  
  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.  
  89. #define _INTEGRAL_MAX_BITS 64
  90.  
  91. typedef long __time32_t;
  92. #define _TIME32_T_DEFINED
  93. typedef __int64 __time64_t;
  94. #define _TIME64_T_DEFINED
  95. #ifdef _USE_32BIT_TIME_T
  96. typedef __time32_t time_t;
  97. #define _TIME_T_DEFINED
  98. #else
  99. typedef __time64_t time_t;
  100. #define _TIME_T_DEFINED
  101. #endif
  102.  
  103. typedef unsigned long size_t;
  104. #define _SIZE_T_DEFINED
  105. typedef long ssize_t;
  106. #define _SSIZE_T_DEFINED
  107.  
  108. typedef unsigned int wint_t;
  109. typedef unsigned short wctype_t;
  110. #define _WCTYPE_T_DEFINED
  111. typedef unsigned short wchar_t;
  112. #define _WCHAR_T_DEFINED
  113.  
  114. typedef int errno_t;
  115. #define _ERRCODE_DEFINED
  116.  
  117. typedef struct threadlocaleinfostruct *pthreadlocinfo;
  118. typedef struct threadmbcinfostruct *pthreadmbcinfo;
  119. typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
  120.  
  121. /* for winapi */
  122. #define _ANONYMOUS_UNION
  123. #define _ANONYMOUS_STRUCT
  124. #define DECLSPEC_NORETURN
  125. #define DECLARE_STDCALL_P(type) __stdcall type
  126. #define NOSERVICE 1
  127. #define NOMCX 1
  128. #define NOIME 1
  129. #ifndef WINVER
  130. # define WINVER 0x0502
  131. #endif
  132. #ifndef _WIN32_WINNT
  133. # define _WIN32_WINNT 0x502
  134. #endif
  135.  
  136. #define __C89_NAMELESS
  137. #define __MINGW_EXTENSION
  138. #define WINAPI_FAMILY_PARTITION(X) 1
  139.  
  140. #endif /* __MINGW_H */
  141.