msi: Make parse_platform() static.
[wine.git] / include / msvcrt / crtdefs.h
blobdde5ea188a59b1fb29f58c409fb8c3adf50c2ca4
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 # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
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 # if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3))
59 # define __stdcall __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
60 # else
61 # define __stdcall __attribute__((ms_abi))
62 # endif
63 # else /* __i386__ */
64 # define __stdcall
65 # endif /* __i386__ */
66 #endif /* __stdcall */
68 #ifndef __cdecl
69 # if defined(__i386__) && defined(__GNUC__)
70 # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
71 # define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
72 # else
73 # define __cdecl __attribute__((__cdecl__))
74 # endif
75 # elif defined(__x86_64__) && defined (__GNUC__)
76 # if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3))
77 # define __cdecl __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
78 # else
79 # define __cdecl __attribute__((ms_abi))
80 # endif
81 # elif !defined(_MSC_VER)
82 # define __cdecl
83 # endif
84 #endif /* __cdecl */
86 #ifndef __ms_va_list
87 # if defined(__x86_64__) && defined (__GNUC__)
88 # define __ms_va_list __builtin_ms_va_list
89 # define __ms_va_start(list,arg) __builtin_ms_va_start(list,arg)
90 # define __ms_va_end(list) __builtin_ms_va_end(list)
91 # define __ms_va_copy(dest,src) __builtin_ms_va_copy(dest,src)
92 # else
93 # define __ms_va_list va_list
94 # define __ms_va_start(list,arg) va_start(list,arg)
95 # define __ms_va_end(list) va_end(list)
96 # ifdef va_copy
97 # define __ms_va_copy(dest,src) va_copy(dest,src)
98 # else
99 # define __ms_va_copy(dest,src) ((dest) = (src))
100 # endif
101 # endif
102 #endif
104 #ifndef DECLSPEC_ALIGN
105 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
106 # define DECLSPEC_ALIGN(x) __declspec(align(x))
107 # elif defined(__GNUC__)
108 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
109 # else
110 # define DECLSPEC_ALIGN(x)
111 # endif
112 #endif
114 #define _ARGMAX 100
116 #ifndef _MSVCRT_LONG_DEFINED
117 #define _MSVCRT_LONG_DEFINED
118 /* we need 32-bit longs even on 64-bit */
119 typedef int __msvcrt_long;
120 typedef unsigned int __msvcrt_ulong;
121 #endif
123 #ifndef _INTPTR_T_DEFINED
124 #ifdef _WIN64
125 typedef __int64 intptr_t;
126 #else
127 typedef int intptr_t;
128 #endif
129 #define _INTPTR_T_DEFINED
130 #endif
132 #ifndef _UINTPTR_T_DEFINED
133 #ifdef _WIN64
134 typedef unsigned __int64 uintptr_t;
135 #else
136 typedef unsigned int uintptr_t;
137 #endif
138 #define _UINTPTR_T_DEFINED
139 #endif
141 #ifndef _PTRDIFF_T_DEFINED
142 #ifdef _WIN64
143 typedef __int64 ptrdiff_t;
144 #else
145 typedef int ptrdiff_t;
146 #endif
147 #define _PTRDIFF_T_DEFINED
148 #endif
150 #ifndef _SIZE_T_DEFINED
151 #ifdef _WIN64
152 typedef unsigned __int64 size_t;
153 #else
154 typedef unsigned int size_t;
155 #endif
156 #define _SIZE_T_DEFINED
157 #endif
159 #ifndef _TIME32_T_DEFINED
160 typedef __msvcrt_long __time32_t;
161 #define _TIME32_T_DEFINED
162 #endif
164 #ifndef _TIME64_T_DEFINED
165 typedef __int64 DECLSPEC_ALIGN(8) __time64_t;
166 #define _TIME64_T_DEFINED
167 #endif
169 #ifdef _USE_32BIT_TIME_T
170 # ifdef _WIN64
171 # error You cannot use 32-bit time_t in Win64
172 # endif
173 #elif !defined(_WIN64)
174 # define _USE_32BIT_TIME_T
175 #endif
177 #ifndef _TIME_T_DEFINED
178 #ifdef _USE_32BIT_TIME_T
179 typedef __time32_t time_t;
180 #else
181 typedef __time64_t time_t;
182 #endif
183 #define _TIME_T_DEFINED
184 #endif
186 #ifndef _WCHAR_T_DEFINED
187 #ifndef __cplusplus
188 typedef unsigned short wchar_t;
189 #endif
190 #define _WCHAR_T_DEFINED
191 #endif
193 #ifndef _WCTYPE_T_DEFINED
194 typedef unsigned short wint_t;
195 typedef unsigned short wctype_t;
196 #define _WCTYPE_T_DEFINED
197 #endif
199 #ifndef _ERRNO_T_DEFINED
200 typedef int errno_t;
201 #define _ERRNO_T_DEFINED
202 #endif
204 struct threadlocaleinfostruct;
205 struct threadmbcinfostruct;
206 typedef struct threadlocaleinfostruct *pthreadlocinfo;
207 typedef struct threadmbcinfostruct *pthreadmbcinfo;
209 typedef struct localeinfo_struct
211 pthreadlocinfo locinfo;
212 pthreadmbcinfo mbcinfo;
213 } _locale_tstruct, *_locale_t;
215 #ifndef _TAGLC_ID_DEFINED
216 typedef struct tagLC_ID {
217 unsigned short wLanguage;
218 unsigned short wCountry;
219 unsigned short wCodePage;
220 } LC_ID, *LPLC_ID;
221 #define _TAGLC_ID_DEFINED
222 #endif
224 #ifndef _THREADLOCALEINFO
225 typedef struct threadlocaleinfostruct {
226 int refcount;
227 unsigned int lc_codepage;
228 unsigned int lc_collate_cp;
229 __msvcrt_ulong lc_handle[6];
230 LC_ID lc_id[6];
231 struct {
232 char *locale;
233 wchar_t *wlocale;
234 int *refcount;
235 int *wrefcount;
236 } lc_category[6];
237 int lc_clike;
238 int mb_cur_max;
239 int *lconv_intl_refcount;
240 int *lconv_num_refcount;
241 int *lconv_mon_refcount;
242 struct lconv *lconv;
243 int *ctype1_refcount;
244 unsigned short *ctype1;
245 const unsigned short *pctype;
246 const unsigned char *pclmap;
247 const unsigned char *pcumap;
248 struct __lc_time_data *lc_time_curr;
249 } threadlocinfo;
250 #define _THREADLOCALEINFO
251 #endif
253 #endif /* __WINE_CRTDEFS_H */