ReactOS  0.4.15-dev-2526-g0fb3c1e
crtdefs.h
Go to the documentation of this file.
1 
6 #include <_mingw.h>
7 #include <specstrings.h>
8 
9 #ifndef _INC_CRTDEFS
10 #define _INC_CRTDEFS
11 
12 #ifdef _USE_32BIT_TIME_T
13 #ifdef _WIN64
14 #error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
15 #undef _USE_32BIT_TIME_T
16 #endif
17 #else
18 #if _INTEGRAL_MAX_BITS < 64
19 #define _USE_32BIT_TIME_T
20 #endif
21 #endif
22 
23 #undef _CRT_PACKING
24 #define _CRT_PACKING 8
25 #pragma pack(push,_CRT_PACKING)
26 
27 /* Disable non-ANSI C definitions if compiling with __STDC__ */
28 //HACK: Disabled
29 //#if __STDC__
30 //#define NO_OLDNAMES
31 //#endif
32 
33 
36 #ifndef _CRT_STRINGIZE
37 #define __CRT_STRINGIZE(_Value) #_Value
38 #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
39 #endif
40 
41 #ifndef _CRT_DEFER_MACRO
42 #define _CRT_DEFER_MACRO(M,...) M(__VA_ARGS__)
43 #endif
44 
45 #ifndef _CRT_WIDE
46 #define __CRT_WIDE(_String) L ## _String
47 #define _CRT_WIDE(_String) __CRT_WIDE(_String)
48 #endif
49 
50 #ifndef _W64
51  #if !defined(_midl) && defined(_X86_) && _MSC_VER >= 1300
52  #define _W64 __w64
53  #else
54  #define _W64
55  #endif
56 #endif
57 
58 #ifndef _CRTIMP
59  #ifdef CRTDLL /* Defined for ntdll, crtdll, msvcrt, etc */
60  #define _CRTIMP
61  #elif defined(_DLL)
62  #define _CRTIMP __declspec(dllimport)
63  #else /* !CRTDLL && !_DLL */
64  #define _CRTIMP
65  #endif /* CRTDLL || _DLL */
66 #endif /* !_CRTIMP */
67 
68 //#define _CRT_ALTERNATIVE_INLINES
69 
70 #ifndef _CRTIMP_ALT
71  #ifdef _DLL
72  #ifdef _CRT_ALTERNATIVE_INLINES
73  #define _CRTIMP_ALT
74  #else
75  #define _CRTIMP_ALT _CRTIMP
76  #define _CRT_ALTERNATIVE_IMPORTED
77  #endif
78  #else
79  #define _CRTIMP_ALT
80  #endif
81 #endif
82 
83 #ifndef _CRTDATA
84  #ifdef _M_CEE_PURE
85  #define _CRTDATA(x) x
86  #else
87  #define _CRTDATA(x) _CRTIMP x
88  #endif
89 #endif
90 
91 #ifndef _CRTIMP2
92  #define _CRTIMP2 _CRTIMP
93 #endif
94 
95 #ifndef _CRTIMP_PURE
96  #define _CRTIMP_PURE _CRTIMP
97 #endif
98 
99 #ifndef _CRTIMP_ALTERNATIVE
100  #define _CRTIMP_ALTERNATIVE _CRTIMP
101  #define _CRT_ALTERNATIVE_IMPORTED
102 #endif
103 
104 #ifndef _CRTIMP_NOIA64
105  #ifdef __ia64__
106  #define _CRTIMP_NOIA64
107  #else
108  #define _CRTIMP_NOIA64 _CRTIMP
109  #endif
110 #endif
111 
112 #ifndef _MRTIMP2
113  #define _MRTIMP2 _CRTIMP
114 #endif
115 
116 #ifndef _MCRTIMP
117  #define _MCRTIMP _CRTIMP
118 #endif
119 
120 #ifndef _PGLOBAL
121  #define _PGLOBAL
122 #endif
123 
124 #ifndef _AGLOBAL
125  #define _AGLOBAL
126 #endif
127 
128 #ifndef _CONST_RETURN
129  #define _CONST_RETURN
130 #endif
131 
132 #ifndef UNALIGNED
133 #if defined(__ia64__) || defined(__x86_64) || defined(__arm__)
134 #define UNALIGNED __unaligned
135 #else
136 #define UNALIGNED
137 #endif
138 #endif
139 
140 #ifndef _CRT_ALIGN
141 #if defined (__midl) || defined(__WIDL__)
142 #define _CRT_ALIGN(x)
143 #elif defined(_MSC_VER)
144 #define _CRT_ALIGN(x) __declspec(align(x))
145 #else
146 #define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
147 #endif
148 #endif
149 
150 #ifndef _CRTNOALIAS
151 #define _CRTNOALIAS
152 #endif
153 
154 #ifndef _CRTRESTRICT
155 #define _CRTRESTRICT
156 #endif
157 
158 #ifndef __CRTDECL
159 #define __CRTDECL __cdecl
160 #endif
161 
162 #ifndef _CRT_UNUSED
163 #define _CRT_UNUSED(x) (void)x
164 #endif
165 
166 #ifndef _CONST_RETURN
167 #ifdef __cplusplus
168 #define _CONST_RETURN const
169 #define _CRT_CONST_CORRECT_OVERLOADS
170 #else
171 #define _CONST_RETURN
172 #endif
173 #endif
174 
175 #define __crt_typefix(ctype)
176 
177 
180 #ifdef __GNUC__
181 #define _CRT_DEPRECATE_TEXT(_Text) __attribute__ ((deprecated))
182 #elif defined(_MSC_VER)
183 #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
184 #else
185 #define _CRT_DEPRECATE_TEXT(_Text)
186 #endif
187 
188 #ifndef __STDC_WANT_SECURE_LIB__
189 #define __STDC_WANT_SECURE_LIB__ 1
190 #endif
191 
192 #ifndef _CRT_INSECURE_DEPRECATE
193 # ifdef _CRT_SECURE_NO_DEPRECATE
194 # define _CRT_INSECURE_DEPRECATE(_Replacement)
195 # else
196 # define _CRT_INSECURE_DEPRECATE(_Replacement) \
197  _CRT_DEPRECATE_TEXT("This may be unsafe, Try " #_Replacement " instead!")
198 # endif
199 #endif
200 
201 #ifndef _CRT_INSECURE_DEPRECATE_CORE
202 # ifdef _CRT_SECURE_NO_DEPRECATE_CORE
203 # define _CRT_INSECURE_DEPRECATE_CORE(_Replacement)
204 # else
205 # define _CRT_INSECURE_DEPRECATE_CORE(_Replacement) \
206  _CRT_DEPRECATE_TEXT("This may be unsafe, Try " #_Replacement " instead! Enable _CRT_SECURE_NO_DEPRECATE to avoid thie warning.")
207 # endif
208 #endif
209 
210 #ifndef _CRT_NONSTDC_DEPRECATE
211 # ifdef _CRT_NONSTDC_NO_DEPRECATE
212 # define _CRT_NONSTDC_DEPRECATE(_Replacement)
213 # else
214 # define _CRT_NONSTDC_DEPRECATE(_Replacement) \
215  _CRT_DEPRECATE_TEXT("Deprecated POSIX name, Try " #_Replacement " instead!")
216 # endif
217 #endif
218 
219 #ifndef _CRT_INSECURE_DEPRECATE_MEMORY
220 #define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
221 #endif
222 
223 #ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
224 #define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
225 #endif
226 
227 #ifndef _CRT_MANAGED_HEAP_DEPRECATE
228 #define _CRT_MANAGED_HEAP_DEPRECATE
229 #endif
230 
231 #ifndef _CRT_OBSOLETE
232 #define _CRT_OBSOLETE(_NewItem)
233 #endif
234 
235 #ifndef _CRT_JIT_INTRINSIC
236 #define _CRT_JIT_INTRINSIC
237 #endif
238 
239 
242 #define _ARGMAX 100
243 
244 #ifndef _TRUNCATE
245 #define _TRUNCATE ((size_t)-1)
246 #endif
247 
248 #ifndef __REACTOS__
249 #define __STDC_SECURE_LIB__ 200411L
250 #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
251 #define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
252 #endif
253 
254 
257 #ifdef __cplusplus
258 extern "C" {
259 #endif
260 
261 #ifndef _SIZE_T_DEFINED
262 #define _SIZE_T_DEFINED
263 #undef size_t
264 #ifdef _WIN64
265 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
266  typedef unsigned int size_t __attribute__ ((mode (DI)));
267 #else
268  __MINGW_EXTENSION typedef unsigned __int64 size_t;
269 #endif
270 #else
271  typedef unsigned int size_t;
272 #endif
273 #endif
274 
275 #ifndef _INTPTR_T_DEFINED
276 #define _INTPTR_T_DEFINED
277 #ifndef __intptr_t_defined
278 #define __intptr_t_defined
279 #undef intptr_t
280 #ifdef _WIN64
281 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
282  typedef int intptr_t __attribute__ ((mode (DI)));
283 #else
285 #endif
286 #else
287  typedef int intptr_t;
288 #endif
289 #endif
290 #endif
291 
292 #ifndef _UINTPTR_T_DEFINED
293 #define _UINTPTR_T_DEFINED
294 #ifndef __uintptr_t_defined
295 #define __uintptr_t_defined
296 #undef uintptr_t
297 #ifdef _WIN64
298 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
299  typedef unsigned int uintptr_t __attribute__ ((mode (DI)));
300 #else
301  __MINGW_EXTENSION typedef unsigned __int64 uintptr_t;
302 #endif
303 #else
304  typedef unsigned int uintptr_t;
305 #endif
306 #endif
307 #endif
308 
309 #ifndef _PTRDIFF_T_DEFINED
310 #define _PTRDIFF_T_DEFINED
311 #ifndef _PTRDIFF_T_
312 #undef ptrdiff_t
313 #ifdef _WIN64
314 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
315  typedef int ptrdiff_t __attribute__ ((mode (DI)));
316 #else
318 #endif
319 #else
320  typedef int ptrdiff_t;
321 #endif
322 #endif
323 #endif
324 
325 #ifndef _WCHAR_T_DEFINED
326 #define _WCHAR_T_DEFINED
327 #if defined(_MSC_VER) || !defined(__cplusplus)
328  typedef unsigned short wchar_t;
329 #endif
330 #endif
331 
332 #ifndef _WCTYPE_T_DEFINED
333 #define _WCTYPE_T_DEFINED
334  typedef unsigned short wint_t;
335  typedef unsigned short wctype_t;
336 #endif
337 
338 #ifdef __GNUC__
339 #ifndef __GNUC_VA_LIST
340 #define __GNUC_VA_LIST
341  typedef __builtin_va_list __gnuc_va_list;
342 #endif
343 #endif
344 
345 #ifndef _VA_LIST_DEFINED
346 #define _VA_LIST_DEFINED
347 #if defined(__GNUC__)
348  typedef __gnuc_va_list va_list;
349 #elif defined(_MSC_VER)
350  typedef _Writable_bytes_(_Inexpressible_("length varies")) char * va_list;
351 #endif
352 #endif
353 
354 #ifndef _ERRCODE_DEFINED
355 #define _ERRCODE_DEFINED
356  typedef int errcode;
357  typedef int errno_t;
358 #endif
359 
360 #ifndef _TIME32_T_DEFINED
361 #define _TIME32_T_DEFINED
362  typedef long __time32_t;
363 #endif
364 
365 #ifndef _TIME64_T_DEFINED
366 #define _TIME64_T_DEFINED
367 #if _INTEGRAL_MAX_BITS >= 64
369 #endif
370 #endif
371 
372 #ifndef _TIME_T_DEFINED
373 #define _TIME_T_DEFINED
374 #ifdef _USE_32BIT_TIME_T
375  typedef __time32_t time_t;
376 #else
378 #endif
379 #endif
380 
381 struct threadmbcinfostruct;
382 typedef struct threadmbcinfostruct *pthreadmbcinfo;
383 
384 #ifndef _TAGLC_ID_DEFINED
385 #define _TAGLC_ID_DEFINED
386  typedef struct tagLC_ID {
387  unsigned short wLanguage;
388  unsigned short wCountry;
389  unsigned short wCodePage;
390  } LC_ID,*LPLC_ID;
391 #endif
392 
393 #ifndef _THREADLOCALEINFO
394 #define _THREADLOCALEINFO
395  typedef struct threadlocaleinfostruct {
396  int refcount;
397  unsigned int lc_codepage;
398  unsigned int lc_collate_cp;
399  unsigned long lc_handle[6];
401  struct {
402  char *locale;
403  wchar_t *wlocale;
404  int *refcount;
405  int *wrefcount;
406  } lc_category[6];
407  int lc_clike;
412  struct lconv *lconv;
414  unsigned short *ctype1;
415  const unsigned short *pctype;
416  const unsigned char *pclmap;
417  const unsigned char *pcumap;
420 #endif
421 
422 struct __lc_time_data;
423 
424 typedef struct localeinfo_struct {
428 
429 #ifdef __cplusplus
430 }
431 #endif
432 
433 #if defined(_PREFAST_) && defined(_PFT_SHOULD_CHECK_RETURN)
434 #define _Check_return_opt_ _Check_return_
435 #else
436 #define _Check_return_opt_
437 #endif
438 
439 #if defined(_PREFAST_) && defined(_PFT_SHOULD_CHECK_RETURN_WAT)
440 #define _Check_return_wat_ _Check_return_
441 #else
442 #define _Check_return_wat_
443 #endif
444 
445 #pragma pack(pop)
446 
447 /* GCC-style diagnostics */
448 #ifndef PRAGMA_DIAGNOSTIC_IGNORED
449 # ifdef __clang__
450 # define PRAGMA_DIAGNOSTIC_PUSH() _Pragma("clang diagnostic push")
451 # define PRAGMA_DIAGNOSTIC_IGNORED(__x) \
452  _Pragma(_CRT_STRINGIZE(clang diagnostic ignored _CRT_DEFER_MACRO(_CRT_STRINGIZE,__x)))
453 # define PRAGMA_DIAGNOSTIC_POP() _Pragma("clang diagnostic pop")
454 # elif defined (__GNUC__)
455 # define PRAGMA_DIAGNOSTIC_PUSH() _Pragma("GCC diagnostic push")
456 # define PRAGMA_DIAGNOSTIC_IGNORED(__x) \
457  _Pragma("GCC diagnostic ignored \"-Wpragmas\"") /* This allows us to use it for unkonwn warnings */ \
458  _Pragma(_CRT_STRINGIZE(GCC diagnostic ignored _CRT_DEFER_MACRO(_CRT_STRINGIZE,__x))) \
459  _Pragma("GCC diagnostic error \"-Wpragmas\"") /* This makes sure that we don't have side effects because we disabled it for our own use. This will be popped anyway. */
460 # define PRAGMA_DIAGNOSTIC_POP() _Pragma("GCC diagnostic pop")
461 # else
462 # define PRAGMA_DIAGNOSTIC_PUSH()
463 # define PRAGMA_DIAGNOSTIC_IGNORED(__x)
464 # define PRAGMA_DIAGNOSTIC_POP()
465 # endif
466 #endif
467 
468 #endif /* !_INC_CRTDEFS */
struct lconv * lconv
Definition: crtdefs.h:412
pthreadlocinfo locinfo
Definition: crtdefs.h:425
pthreadmbcinfo mbcinfo
Definition: crtdefs.h:426
#define _Writable_bytes_(s)
Definition: no_sal2.h:70
struct threadlocaleinfostruct threadlocinfo
unsigned short wLanguage
Definition: crtdefs.h:387
__time64_t time_t
Definition: crtdefs.h:377
struct threadmbcinfostruct * pthreadmbcinfo
Definition: crtdefs.h:382
long __time32_t
Definition: crtdefs.h:362
unsigned short wctype_t
Definition: crtdefs.h:335
unsigned int size_t
Definition: crtdefs.h:271
unsigned long lc_handle[6]
Definition: crtdefs.h:399
unsigned short wint_t
Definition: crtdefs.h:334
unsigned short wCountry
Definition: crtdefs.h:388
struct threadlocaleinfostruct * pthreadlocinfo
#define __attribute__(x)
Definition: wpp_private.h:207
struct localeinfo_struct * _locale_t
Definition: string.c:96
unsigned short wCodePage
Definition: crtdefs.h:389
unsigned int uintptr_t
Definition: crtdefs.h:304
#define __MINGW_EXTENSION
Definition: _mingw.h:166
unsigned int lc_codepage
Definition: crtdefs.h:397
unsigned char
Definition: typeof.h:29
Definition: locale.h:37
char * va_list
Definition: acmsvcex.h:78
int errno_t
Definition: crtdefs.h:357
unsigned short wchar_t
Definition: crtdefs.h:328
struct localeinfo_struct _locale_tstruct
int errcode
Definition: crtdefs.h:356
int intptr_t
Definition: crtdefs.h:287
int ptrdiff_t
Definition: crtdefs.h:320
const unsigned short * pctype
Definition: crtdefs.h:415
struct __lc_time_data * lc_time_curr
Definition: crtdefs.h:418
const unsigned char * pclmap
Definition: crtdefs.h:416
GLenum mode
Definition: glext.h:6217
const unsigned char * pcumap
Definition: crtdefs.h:417
struct threadlocaleinfostruct::@1859 lc_category[6]
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
struct tagLC_ID * LPLC_ID
struct tagLC_ID LC_ID
unsigned int lc_collate_cp
Definition: crtdefs.h:398
unsigned short * ctype1
Definition: crtdefs.h:414
#define __int64
Definition: basetyps.h:16
__MINGW_EXTENSION typedef __int64 __time64_t
Definition: crtdefs.h:368