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_CRTDEFS_H
22 #define __WINE_CRTDEFS_H
24 #ifndef __WINE_USE_MSVCRT
25 #define __WINE_USE_MSVCRT
28 #ifdef __WINE_WINE_PORT_H
29 # error You cannot use both wine/port.h and msvcrt headers
32 #if (defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__)) && !defined(_WIN64)
36 #if !defined(_MSC_VER) && !defined(__int64)
37 # if defined(_WIN64) && !defined(__MINGW64__)
40 # define __int64 long long
47 # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
48 # define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
50 # define __stdcall __attribute__((__stdcall__))
52 # elif defined(_MSC_VER)
53 /* Nothing needs to be done. __stdcall already exists */
55 # error You need to define __stdcall for your compiler
57 # elif defined(__x86_64__) && defined (__GNUC__)
58 # if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3))
59 # define __stdcall __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
61 # define __stdcall __attribute__((ms_abi))
63 # elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__)
64 # define __stdcall __attribute__((pcs("aapcs-vfp")))
67 # endif /* __i386__ */
68 #endif /* __stdcall */
71 # if defined(__i386__) && defined(__GNUC__)
72 # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
73 # define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
75 # define __cdecl __attribute__((__cdecl__))
77 # elif defined(__x86_64__) && defined (__GNUC__)
78 # if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3))
79 # define __cdecl __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
81 # define __cdecl __attribute__((ms_abi))
83 # elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__)
84 # define __cdecl __attribute__((pcs("aapcs-vfp")))
85 # elif !defined(_MSC_VER)
91 # if defined(__x86_64__) && defined (__GNUC__)
92 # define __ms_va_list __builtin_ms_va_list
93 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
94 # define __ms_va_end(list) __builtin_ms_va_end(list)
95 # define __ms_va_copy(dest,src) __builtin_ms_va_copy(dest,src)
97 # define __ms_va_list va_list
98 # define __ms_va_start(list,arg) va_start(list,arg)
99 # define __ms_va_end(list) va_end(list)
101 # define __ms_va_copy(dest,src) va_copy(dest,src)
103 # define __ms_va_copy(dest,src) ((dest) = (src))
109 # if defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__)
110 # define WINAPIV __attribute__((pcs("aapcs")))
112 # define WINAPIV __cdecl
116 #ifndef DECLSPEC_ALIGN
117 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
118 # define DECLSPEC_ALIGN(x) __declspec(align(x))
119 # elif defined(__GNUC__)
120 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
122 # define DECLSPEC_ALIGN(x)
128 #ifndef _MSVCRT_LONG_DEFINED
129 #define _MSVCRT_LONG_DEFINED
130 /* we need 32-bit longs even on 64-bit */
131 typedef int __msvcrt_long
;
132 typedef unsigned int __msvcrt_ulong
;
135 #ifndef _INTPTR_T_DEFINED
137 typedef __int64
intptr_t;
139 typedef int intptr_t;
141 #define _INTPTR_T_DEFINED
144 #ifndef _UINTPTR_T_DEFINED
146 typedef unsigned __int64
uintptr_t;
148 typedef unsigned int uintptr_t;
150 #define _UINTPTR_T_DEFINED
153 #ifndef _PTRDIFF_T_DEFINED
155 typedef __int64
ptrdiff_t;
157 typedef int ptrdiff_t;
159 #define _PTRDIFF_T_DEFINED
162 #ifndef _SIZE_T_DEFINED
164 typedef unsigned __int64
size_t;
166 typedef unsigned int size_t;
168 #define _SIZE_T_DEFINED
171 #ifndef _TIME32_T_DEFINED
172 typedef __msvcrt_long __time32_t
;
173 #define _TIME32_T_DEFINED
176 #ifndef _TIME64_T_DEFINED
177 typedef __int64
DECLSPEC_ALIGN(8) __time64_t
;
178 #define _TIME64_T_DEFINED
181 #ifdef _USE_32BIT_TIME_T
183 # error You cannot use 32-bit time_t in Win64
185 #elif !defined(_WIN64)
186 # define _USE_32BIT_TIME_T
189 #ifndef _TIME_T_DEFINED
190 #ifdef _USE_32BIT_TIME_T
191 typedef __time32_t
time_t;
193 typedef __time64_t
time_t;
195 #define _TIME_T_DEFINED
198 #ifndef _WCHAR_T_DEFINED
200 typedef unsigned short wchar_t;
202 #define _WCHAR_T_DEFINED
205 #ifndef _WCTYPE_T_DEFINED
206 typedef unsigned short wint_t;
207 typedef unsigned short wctype_t;
208 #define _WCTYPE_T_DEFINED
211 #ifndef _ERRNO_T_DEFINED
213 #define _ERRNO_T_DEFINED
216 struct threadlocaleinfostruct
;
217 struct threadmbcinfostruct
;
218 typedef struct threadlocaleinfostruct
*pthreadlocinfo
;
219 typedef struct threadmbcinfostruct
*pthreadmbcinfo
;
221 typedef struct localeinfo_struct
223 pthreadlocinfo locinfo
;
224 pthreadmbcinfo mbcinfo
;
225 } _locale_tstruct
, *_locale_t
;
227 #ifndef _TAGLC_ID_DEFINED
228 typedef struct tagLC_ID
{
229 unsigned short wLanguage
;
230 unsigned short wCountry
;
231 unsigned short wCodePage
;
233 #define _TAGLC_ID_DEFINED
236 #ifndef _THREADLOCALEINFO
237 typedef struct threadlocaleinfostruct
{
239 unsigned int lc_codepage
;
240 unsigned int lc_collate_cp
;
241 __msvcrt_ulong lc_handle
[6];
251 int *lconv_intl_refcount
;
252 int *lconv_num_refcount
;
253 int *lconv_mon_refcount
;
255 int *ctype1_refcount
;
256 unsigned short *ctype1
;
257 const unsigned short *pctype
;
258 const unsigned char *pclmap
;
259 const unsigned char *pcumap
;
260 struct __lc_time_data
*lc_time_curr
;
262 #define _THREADLOCALEINFO
265 #endif /* __WINE_CRTDEFS_H */