4 * Copyright 2000 Francois Gouget.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_USE_MSVCRT
22 #define __WINE_USE_MSVCRT
25 #if defined(__x86_64__) && !defined(_WIN64)
29 #if !defined(_MSC_VER) && !defined(__int64)
30 # if defined(_WIN64) && !defined(__MINGW64__)
33 # define __int64 long long
40 # ifdef __APPLE__ /* Mac OS X uses a 16-byte aligned stack and not a 4-byte one */
41 # define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
43 # define __stdcall __attribute__((__stdcall__))
45 # elif defined(_MSC_VER)
46 /* Nothing needs to be done. __stdcall already exists */
48 # error You need to define __stdcall for your compiler
50 # elif defined(__x86_64__) && defined (__GNUC__)
51 # define __stdcall __attribute__((ms_abi))
55 #endif /* __stdcall */
58 # if defined(__i386__) && defined(__GNUC__)
59 # ifdef __APPLE__ /* Mac OS X uses 16-byte aligned stack and not a 4-byte one */
60 # define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
62 # define __cdecl __attribute__((__cdecl__))
64 # elif defined(__x86_64__) && defined (__GNUC__)
65 # define __cdecl __attribute__((ms_abi))
66 # elif !defined(_MSC_VER)
72 # if defined(__x86_64__) && defined (__GNUC__)
73 # define __ms_va_list __builtin_ms_va_list
74 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
75 # define __ms_va_end(list) __builtin_ms_va_end(list)
77 # define __ms_va_list va_list
78 # define __ms_va_start(list,arg) va_start(list,arg)
79 # define __ms_va_end(list) va_end(list)
83 #ifndef DECLSPEC_ALIGN
84 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
85 # define DECLSPEC_ALIGN(x) __declspec(align(x))
86 # elif defined(__GNUC__)
87 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
89 # define DECLSPEC_ALIGN(x)
93 #ifndef _MSVCRT_LONG_DEFINED
94 #define _MSVCRT_LONG_DEFINED
95 /* we need 32-bit longs even on 64-bit */
96 typedef int __msvcrt_long
;
97 typedef unsigned int __msvcrt_ulong
;
100 #ifndef _INTPTR_T_DEFINED
102 typedef __int64
intptr_t;
104 typedef int intptr_t;
106 #define _INTPTR_T_DEFINED
109 #ifndef _UINTPTR_T_DEFINED
111 typedef unsigned __int64
uintptr_t;
113 typedef unsigned int uintptr_t;
115 #define _UINTPTR_T_DEFINED
118 #ifndef _PTRDIFF_T_DEFINED
120 typedef __int64
ptrdiff_t;
122 typedef int ptrdiff_t;
124 #define _PTRDIFF_T_DEFINED
127 #ifndef _SIZE_T_DEFINED
129 typedef unsigned __int64
size_t;
131 typedef unsigned int size_t;
133 #define _SIZE_T_DEFINED
136 #ifndef _TIME32_T_DEFINED
137 typedef __msvcrt_long __time32_t
;
138 #define _TIME32_T_DEFINED
141 #ifndef _TIME64_T_DEFINED
142 typedef __int64
DECLSPEC_ALIGN(8) __time64_t
;
143 #define _TIME64_T_DEFINED
146 #ifdef _USE_32BIT_TIME_T
148 # error You cannot use 32-bit time_t in Win64
150 #elif !defined(_WIN64)
151 # define _USE_32BIT_TIME_T
154 #ifndef _TIME_T_DEFINED
155 #ifdef _USE_32BIT_TIME_T
156 typedef __time32_t
time_t;
158 typedef __time64_t
time_t;
160 #define _TIME_T_DEFINED
163 #ifndef _WCHAR_T_DEFINED
165 typedef unsigned short wchar_t;
167 #define _WCHAR_T_DEFINED
170 #ifndef _WCTYPE_T_DEFINED
171 typedef unsigned short wint_t;
172 typedef unsigned short wctype_t;
173 #define _WCTYPE_T_DEFINED
176 #ifndef _ERRNO_T_DEFINED
178 #define _ERRNO_T_DEFINED