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(_WIN64)
36 #if !defined(_MSC_VER) && !defined(__int64)
37 # if defined(_WIN64) && !defined(__MINGW64__)
40 # define __int64 long long
47 # ifdef __APPLE__ /* Mac OS X uses a 16-byte aligned stack and not a 4-byte one */
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 # define __stdcall __attribute__((ms_abi))
62 #endif /* __stdcall */
65 # if defined(__i386__) && defined(__GNUC__)
66 # ifdef __APPLE__ /* Mac OS X uses 16-byte aligned stack and not a 4-byte one */
67 # define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
69 # define __cdecl __attribute__((__cdecl__))
71 # elif defined(__x86_64__) && defined (__GNUC__)
72 # define __cdecl __attribute__((ms_abi))
73 # elif !defined(_MSC_VER)
79 # if defined(__x86_64__) && defined (__GNUC__)
80 # define __ms_va_list __builtin_ms_va_list
81 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
82 # define __ms_va_end(list) __builtin_ms_va_end(list)
84 # define __ms_va_list va_list
85 # define __ms_va_start(list,arg) va_start(list,arg)
86 # define __ms_va_end(list) va_end(list)
90 #ifndef DECLSPEC_ALIGN
91 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
92 # define DECLSPEC_ALIGN(x) __declspec(align(x))
93 # elif defined(__GNUC__)
94 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
96 # define DECLSPEC_ALIGN(x)
100 #ifndef _MSVCRT_LONG_DEFINED
101 #define _MSVCRT_LONG_DEFINED
102 /* we need 32-bit longs even on 64-bit */
103 typedef int __msvcrt_long;
104 typedef unsigned int __msvcrt_ulong;
107 #ifndef _INTPTR_T_DEFINED
109 typedef __int64 intptr_t;
111 typedef int intptr_t;
113 #define _INTPTR_T_DEFINED
116 #ifndef _UINTPTR_T_DEFINED
118 typedef unsigned __int64 uintptr_t;
120 typedef unsigned int uintptr_t;
122 #define _UINTPTR_T_DEFINED
125 #ifndef _PTRDIFF_T_DEFINED
127 typedef __int64 ptrdiff_t;
129 typedef int ptrdiff_t;
131 #define _PTRDIFF_T_DEFINED
134 #ifndef _SIZE_T_DEFINED
136 typedef unsigned __int64 size_t;
138 typedef unsigned int size_t;
140 #define _SIZE_T_DEFINED
143 #ifndef _TIME32_T_DEFINED
144 typedef __msvcrt_long __time32_t;
145 #define _TIME32_T_DEFINED
148 #ifndef _TIME64_T_DEFINED
149 typedef __int64 DECLSPEC_ALIGN(8) __time64_t;
150 #define _TIME64_T_DEFINED
153 #ifdef _USE_32BIT_TIME_T
155 # error You cannot use 32-bit time_t in Win64
157 #elif !defined(_WIN64)
158 # define _USE_32BIT_TIME_T
161 #ifndef _TIME_T_DEFINED
162 #ifdef _USE_32BIT_TIME_T
163 typedef __time32_t time_t;
165 typedef __time64_t time_t;
167 #define _TIME_T_DEFINED
170 #ifndef _WCHAR_T_DEFINED
172 typedef unsigned short wchar_t;
174 #define _WCHAR_T_DEFINED
177 #ifndef _WCTYPE_T_DEFINED
178 typedef unsigned short wint_t;
179 typedef unsigned short wctype_t;
180 #define _WCTYPE_T_DEFINED
183 #ifndef _ERRNO_T_DEFINED
185 #define _ERRNO_T_DEFINED
188 struct threadlocaleinfostruct;
189 struct threadmbcinfostruct;
190 typedef struct threadlocaleinfostruct *pthreadlocinfo;
191 typedef struct threadmbcinfostruct *pthreadmbcinfo;
193 typedef struct localeinfo_struct
195 pthreadlocinfo locinfo;
196 pthreadmbcinfo mbcinfo;
197 } _locale_tstruct, *_locale_t;
199 #ifndef _TAGLC_ID_DEFINED
200 typedef struct tagLC_ID {
201 unsigned short wLanguage;
202 unsigned short wCountry;
203 unsigned short wCodePage;
205 #define _TAGLC_ID_DEFINED
208 #ifndef _THREADLOCALEINFO
209 typedef struct threadlocaleinfostruct {
211 unsigned int lc_codepage;
212 unsigned int lc_collate_cp;
213 unsigned long lc_handle[6];
223 int *lconv_intl_refcount;
224 int *lconv_num_refcount;
225 int *lconv_mon_refcount;
227 int *ctype1_refcount;
228 unsigned short *ctype1;
229 const unsigned short *pctype;
230 const unsigned char *pclmap;
231 const unsigned char *pcumap;
232 struct __lc_time_data *lc_time_curr;
234 #define _THREADLOCALEINFO
237 #endif /* __WINE_CRTDEFS_H */