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