user32/tests: Add tests for calling EmptyClipboard from a different thread.
[wine.git] / include / msvcrt / crtdefs.h
blobf2600ad477104cb9cdeb1d3e49eb680037dcf94c
1 /*
2 * CRT definitions
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
26 #endif
28 #ifdef __WINE_WINE_PORT_H
29 # error You cannot use both wine/port.h and msvcrt headers
30 #endif
32 #if (defined(__x86_64__) || defined(__powerpc64__) || defined(__sparc64__) || defined(__aarch64__)) && !defined(_WIN64)
33 #define _WIN64
34 #endif
36 #if !defined(_MSC_VER) && !defined(__int64)
37 # if defined(_WIN64) && !defined(__MINGW64__)
38 # define __int64 long
39 # else
40 # define __int64 long long
41 # endif
42 #endif
44 #ifndef __stdcall
45 # ifdef __i386__
46 # ifdef __GNUC__
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__))
49 # else
50 # define __stdcall __attribute__((__stdcall__))
51 # endif
52 # elif defined(_MSC_VER)
53 /* Nothing needs to be done. __stdcall already exists */
54 # else
55 # error You need to define __stdcall for your compiler
56 # endif
57 # elif defined(__x86_64__) && defined (__GNUC__)
58 # define __stdcall __attribute__((ms_abi))
59 # else
60 # define __stdcall
61 # endif
62 #endif /* __stdcall */
64 #ifndef __cdecl
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__))
68 # else
69 # define __cdecl __attribute__((__cdecl__))
70 # endif
71 # elif defined(__x86_64__) && defined (__GNUC__)
72 # define __cdecl __attribute__((ms_abi))
73 # elif !defined(_MSC_VER)
74 # define __cdecl
75 # endif
76 #endif /* __cdecl */
78 #ifndef __ms_va_list
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)
83 # define __ms_va_copy(dest,src) __builtin_ms_va_copy(dest,src)
84 # else
85 # define __ms_va_list va_list
86 # define __ms_va_start(list,arg) va_start(list,arg)
87 # define __ms_va_end(list) va_end(list)
88 # ifdef va_copy
89 # define __ms_va_copy(dest,src) va_copy(dest,src)
90 # else
91 # define __ms_va_copy(dest,src) ((dest) = (src))
92 # endif
93 # endif
94 #endif
96 #ifndef DECLSPEC_ALIGN
97 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
98 # define DECLSPEC_ALIGN(x) __declspec(align(x))
99 # elif defined(__GNUC__)
100 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
101 # else
102 # define DECLSPEC_ALIGN(x)
103 # endif
104 #endif
106 #define _ARGMAX 100
108 #ifndef _MSVCRT_LONG_DEFINED
109 #define _MSVCRT_LONG_DEFINED
110 /* we need 32-bit longs even on 64-bit */
111 typedef int __msvcrt_long;
112 typedef unsigned int __msvcrt_ulong;
113 #endif
115 #ifndef _INTPTR_T_DEFINED
116 #ifdef _WIN64
117 typedef __int64 intptr_t;
118 #else
119 typedef int intptr_t;
120 #endif
121 #define _INTPTR_T_DEFINED
122 #endif
124 #ifndef _UINTPTR_T_DEFINED
125 #ifdef _WIN64
126 typedef unsigned __int64 uintptr_t;
127 #else
128 typedef unsigned int uintptr_t;
129 #endif
130 #define _UINTPTR_T_DEFINED
131 #endif
133 #ifndef _PTRDIFF_T_DEFINED
134 #ifdef _WIN64
135 typedef __int64 ptrdiff_t;
136 #else
137 typedef int ptrdiff_t;
138 #endif
139 #define _PTRDIFF_T_DEFINED
140 #endif
142 #ifndef _SIZE_T_DEFINED
143 #ifdef _WIN64
144 typedef unsigned __int64 size_t;
145 #else
146 typedef unsigned int size_t;
147 #endif
148 #define _SIZE_T_DEFINED
149 #endif
151 #ifndef _TIME32_T_DEFINED
152 typedef __msvcrt_long __time32_t;
153 #define _TIME32_T_DEFINED
154 #endif
156 #ifndef _TIME64_T_DEFINED
157 typedef __int64 DECLSPEC_ALIGN(8) __time64_t;
158 #define _TIME64_T_DEFINED
159 #endif
161 #ifdef _USE_32BIT_TIME_T
162 # ifdef _WIN64
163 # error You cannot use 32-bit time_t in Win64
164 # endif
165 #elif !defined(_WIN64)
166 # define _USE_32BIT_TIME_T
167 #endif
169 #ifndef _TIME_T_DEFINED
170 #ifdef _USE_32BIT_TIME_T
171 typedef __time32_t time_t;
172 #else
173 typedef __time64_t time_t;
174 #endif
175 #define _TIME_T_DEFINED
176 #endif
178 #ifndef _WCHAR_T_DEFINED
179 #ifndef __cplusplus
180 typedef unsigned short wchar_t;
181 #endif
182 #define _WCHAR_T_DEFINED
183 #endif
185 #ifndef _WCTYPE_T_DEFINED
186 typedef unsigned short wint_t;
187 typedef unsigned short wctype_t;
188 #define _WCTYPE_T_DEFINED
189 #endif
191 #ifndef _ERRNO_T_DEFINED
192 typedef int errno_t;
193 #define _ERRNO_T_DEFINED
194 #endif
196 struct threadlocaleinfostruct;
197 struct threadmbcinfostruct;
198 typedef struct threadlocaleinfostruct *pthreadlocinfo;
199 typedef struct threadmbcinfostruct *pthreadmbcinfo;
201 typedef struct localeinfo_struct
203 pthreadlocinfo locinfo;
204 pthreadmbcinfo mbcinfo;
205 } _locale_tstruct, *_locale_t;
207 #ifndef _TAGLC_ID_DEFINED
208 typedef struct tagLC_ID {
209 unsigned short wLanguage;
210 unsigned short wCountry;
211 unsigned short wCodePage;
212 } LC_ID, *LPLC_ID;
213 #define _TAGLC_ID_DEFINED
214 #endif
216 #ifndef _THREADLOCALEINFO
217 typedef struct threadlocaleinfostruct {
218 int refcount;
219 unsigned int lc_codepage;
220 unsigned int lc_collate_cp;
221 __msvcrt_ulong lc_handle[6];
222 LC_ID lc_id[6];
223 struct {
224 char *locale;
225 wchar_t *wlocale;
226 int *refcount;
227 int *wrefcount;
228 } lc_category[6];
229 int lc_clike;
230 int mb_cur_max;
231 int *lconv_intl_refcount;
232 int *lconv_num_refcount;
233 int *lconv_mon_refcount;
234 struct lconv *lconv;
235 int *ctype1_refcount;
236 unsigned short *ctype1;
237 const unsigned short *pctype;
238 const unsigned char *pclmap;
239 const unsigned char *pcumap;
240 struct __lc_time_data *lc_time_curr;
241 } threadlocinfo;
242 #define _THREADLOCALEINFO
243 #endif
245 #endif /* __WINE_CRTDEFS_H */