ReactOS  0.4.15-dev-2991-g632fa1c
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__)
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 
188 #ifdef __GNUC__
189 #define _CRT_DEPRECATE_TEXT(_Text) __attribute__ ((deprecated))
190 #elif defined(_MSC_VER)
191 #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
192 #else
193 #define _CRT_DEPRECATE_TEXT(_Text)
194 #endif
195 
196 #ifndef __STDC_WANT_SECURE_LIB__
197 #define __STDC_WANT_SECURE_LIB__ 1
198 #endif
199 
200 #ifndef _CRT_INSECURE_DEPRECATE
201 # ifdef _CRT_SECURE_NO_DEPRECATE
202 # define _CRT_INSECURE_DEPRECATE(_Replacement)
203 # else
204 # define _CRT_INSECURE_DEPRECATE(_Replacement) \
205  _CRT_DEPRECATE_TEXT("This may be unsafe, Try " #_Replacement " instead!")
206 # endif
207 #endif
208 
209 #ifndef _CRT_INSECURE_DEPRECATE_CORE
210 # ifdef _CRT_SECURE_NO_DEPRECATE_CORE
211 # define _CRT_INSECURE_DEPRECATE_CORE(_Replacement)
212 # else
213 # define _CRT_INSECURE_DEPRECATE_CORE(_Replacement) \
214  _CRT_DEPRECATE_TEXT("This may be unsafe, Try " #_Replacement " instead! Enable _CRT_SECURE_NO_DEPRECATE to avoid thie warning.")
215 # endif
216 #endif
217 
218 #ifndef _CRT_NONSTDC_DEPRECATE
219 # ifdef _CRT_NONSTDC_NO_DEPRECATE
220 # define _CRT_NONSTDC_DEPRECATE(_Replacement)
221 # else
222 # define _CRT_NONSTDC_DEPRECATE(_Replacement) \
223  _CRT_DEPRECATE_TEXT("Deprecated POSIX name, Try " #_Replacement " instead!")
224 # endif
225 #endif
226 
227 #ifndef _CRT_INSECURE_DEPRECATE_MEMORY
228 #define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
229 #endif
230 
231 #ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
232 #define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
233 #endif
234 
235 #ifndef _CRT_MANAGED_HEAP_DEPRECATE
236 #define _CRT_MANAGED_HEAP_DEPRECATE
237 #endif
238 
239 #ifndef _CRT_OBSOLETE
240 #define _CRT_OBSOLETE(_NewItem)
241 #endif
242 
243 #ifndef _CRT_JIT_INTRINSIC
244 #define _CRT_JIT_INTRINSIC
245 #endif
246 
247 
250 #define _ARGMAX 100
251 
252 #ifndef _TRUNCATE
253 #define _TRUNCATE ((size_t)-1)
254 #endif
255 
256 #ifndef __REACTOS__
257 #define __STDC_SECURE_LIB__ 200411L
258 #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
259 #define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
260 #endif
261 
262 
265 #ifdef __cplusplus
266 extern "C" {
267 #endif
268 
269 #ifndef _SIZE_T_DEFINED
270 #define _SIZE_T_DEFINED
271 #undef size_t
272 #ifdef _WIN64
273 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
274  typedef unsigned int size_t __attribute__ ((mode (DI)));
275 #else
276  __MINGW_EXTENSION typedef unsigned __int64 size_t;
277 #endif
278 #else
279  typedef unsigned int size_t;
280 #endif
281 #endif
282 
283 #ifndef _INTPTR_T_DEFINED
284 #define _INTPTR_T_DEFINED
285 #ifndef __intptr_t_defined
286 #define __intptr_t_defined
287 #undef intptr_t
288 #ifdef _WIN64
289 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
290  typedef int intptr_t __attribute__ ((mode (DI)));
291 #else
293 #endif
294 #else
295  typedef int intptr_t;
296 #endif
297 #endif
298 #endif
299 
300 #ifndef _UINTPTR_T_DEFINED
301 #define _UINTPTR_T_DEFINED
302 #ifndef __uintptr_t_defined
303 #define __uintptr_t_defined
304 #undef uintptr_t
305 #ifdef _WIN64
306 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
307  typedef unsigned int uintptr_t __attribute__ ((mode (DI)));
308 #else
309  __MINGW_EXTENSION typedef unsigned __int64 uintptr_t;
310 #endif
311 #else
312  typedef unsigned int uintptr_t;
313 #endif
314 #endif
315 #endif
316 
317 #ifndef _PTRDIFF_T_DEFINED
318 #define _PTRDIFF_T_DEFINED
319 #ifndef _PTRDIFF_T_
320 #undef ptrdiff_t
321 #ifdef _WIN64
322 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
323  typedef int ptrdiff_t __attribute__ ((mode (DI)));
324 #else
326 #endif
327 #else
328  typedef int ptrdiff_t;
329 #endif
330 #endif
331 #endif
332 
333 #ifndef _WCHAR_T_DEFINED
334 #define _WCHAR_T_DEFINED
335 #if defined(_MSC_VER) || !defined(__cplusplus)
336  typedef unsigned short wchar_t;
337 #endif
338 #endif
339 
340 #ifndef _WCTYPE_T_DEFINED
341 #define _WCTYPE_T_DEFINED
342  typedef unsigned short wint_t;
343  typedef unsigned short wctype_t;
344 #endif
345 
346 #ifdef __GNUC__
347 #ifndef __GNUC_VA_LIST
348 #define __GNUC_VA_LIST
349  typedef __builtin_va_list __gnuc_va_list;
350 #endif
351 #endif
352 
353 #ifndef _VA_LIST_DEFINED
354 #define _VA_LIST_DEFINED
355 #if defined(__GNUC__)
356  typedef __gnuc_va_list va_list;
357 #elif defined(_MSC_VER)
358  typedef _Writable_bytes_(_Inexpressible_("length varies")) char * va_list;
359 #endif
360 #endif
361 
362 #ifndef _ERRCODE_DEFINED
363 #define _ERRCODE_DEFINED
364  typedef int errcode;
365  typedef int errno_t;
366 #endif
367 
368 #ifndef _TIME32_T_DEFINED
369 #define _TIME32_T_DEFINED
370  typedef long __time32_t;
371 #endif
372 
373 #ifndef _TIME64_T_DEFINED
374 #define _TIME64_T_DEFINED
375 #if _INTEGRAL_MAX_BITS >= 64
377 #endif
378 #endif
379 
380 #ifndef _TIME_T_DEFINED
381 #define _TIME_T_DEFINED
382 #ifdef _USE_32BIT_TIME_T
383  typedef __time32_t time_t;
384 #else
386 #endif
387 #endif
388 
389 struct threadmbcinfostruct;
390 typedef struct threadmbcinfostruct *pthreadmbcinfo;
391 
392 #ifndef _TAGLC_ID_DEFINED
393 #define _TAGLC_ID_DEFINED
394  typedef struct tagLC_ID {
395  unsigned short wLanguage;
396  unsigned short wCountry;
397  unsigned short wCodePage;
398  } LC_ID,*LPLC_ID;
399 #endif
400 
401 #ifndef _THREADLOCALEINFO
402 #define _THREADLOCALEINFO
403  typedef struct threadlocaleinfostruct {
404  int refcount;
405  unsigned int lc_codepage;
406  unsigned int lc_collate_cp;
407  unsigned long lc_handle[6];
409  struct {
410  char *locale;
411  wchar_t *wlocale;
412  int *refcount;
413  int *wrefcount;
414  } lc_category[6];
415  int lc_clike;
420  struct lconv *lconv;
422  unsigned short *ctype1;
423  const unsigned short *pctype;
424  const unsigned char *pclmap;
425  const unsigned char *pcumap;
428 #endif
429 
430 struct __lc_time_data;
431 
432 typedef struct localeinfo_struct {
436 
437 #ifdef __cplusplus
438 }
439 #endif
440 
441 #if defined(_PREFAST_) && defined(_PFT_SHOULD_CHECK_RETURN)
442 #define _Check_return_opt_ _Check_return_
443 #else
444 #define _Check_return_opt_
445 #endif
446 
447 #if defined(_PREFAST_) && defined(_PFT_SHOULD_CHECK_RETURN_WAT)
448 #define _Check_return_wat_ _Check_return_
449 #else
450 #define _Check_return_wat_
451 #endif
452 
453 #pragma pack(pop)
454 
455 /* GCC-style diagnostics */
456 #ifndef PRAGMA_DIAGNOSTIC_IGNORED
457 # ifdef __clang__
458 # define PRAGMA_DIAGNOSTIC_PUSH() _Pragma("clang diagnostic push")
459 # define PRAGMA_DIAGNOSTIC_IGNORED(__x) \
460  _Pragma(_CRT_STRINGIZE(clang diagnostic ignored _CRT_DEFER_MACRO(_CRT_STRINGIZE,__x)))
461 # define PRAGMA_DIAGNOSTIC_POP() _Pragma("clang diagnostic pop")
462 # elif defined (__GNUC__)
463 # define PRAGMA_DIAGNOSTIC_PUSH() _Pragma("GCC diagnostic push")
464 # define PRAGMA_DIAGNOSTIC_IGNORED(__x) \
465  _Pragma("GCC diagnostic ignored \"-Wpragmas\"") /* This allows us to use it for unkonwn warnings */ \
466  _Pragma(_CRT_STRINGIZE(GCC diagnostic ignored _CRT_DEFER_MACRO(_CRT_STRINGIZE,__x))) \
467  _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. */
468 # define PRAGMA_DIAGNOSTIC_POP() _Pragma("GCC diagnostic pop")
469 # else
470 # define PRAGMA_DIAGNOSTIC_PUSH()
471 # define PRAGMA_DIAGNOSTIC_IGNORED(__x)
472 # define PRAGMA_DIAGNOSTIC_POP()
473 # endif
474 #endif
475 
476 #endif /* !_INC_CRTDEFS */
struct lconv * lconv
Definition: crtdefs.h:420
pthreadlocinfo locinfo
Definition: crtdefs.h:433
pthreadmbcinfo mbcinfo
Definition: crtdefs.h:434
struct threadlocaleinfostruct threadlocinfo
unsigned short wLanguage
Definition: crtdefs.h:395
__time64_t time_t
Definition: crtdefs.h:385
struct threadmbcinfostruct * pthreadmbcinfo
Definition: crtdefs.h:390
long __time32_t
Definition: crtdefs.h:370
unsigned short wctype_t
Definition: crtdefs.h:343
unsigned int size_t
Definition: crtdefs.h:279
unsigned long lc_handle[6]
Definition: crtdefs.h:407
unsigned short wint_t
Definition: crtdefs.h:342
unsigned short wCountry
Definition: crtdefs.h:396
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:397
unsigned int uintptr_t
Definition: crtdefs.h:312
#define __MINGW_EXTENSION
Definition: _mingw.h:166
unsigned int lc_codepage
Definition: crtdefs.h:405
unsigned char
Definition: typeof.h:29
Definition: locale.h:29
char * va_list
Definition: acmsvcex.h:78
int errno_t
Definition: crtdefs.h:365
unsigned short wchar_t
Definition: crtdefs.h:336
struct localeinfo_struct _locale_tstruct
#define _Writable_bytes_(size)
Definition: ms_sal.h:637
int errcode
Definition: crtdefs.h:364
int intptr_t
Definition: crtdefs.h:295
int ptrdiff_t
Definition: crtdefs.h:328
const unsigned short * pctype
Definition: crtdefs.h:423
struct __lc_time_data * lc_time_curr
Definition: crtdefs.h:426
struct threadlocaleinfostruct::@1842 lc_category[6]
const unsigned char * pclmap
Definition: crtdefs.h:424
GLenum mode
Definition: glext.h:6217
const unsigned char * pcumap
Definition: crtdefs.h:425
__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:406
unsigned short * ctype1
Definition: crtdefs.h:422
#define __int64
Definition: basetyps.h:16
__MINGW_EXTENSION typedef __int64 __time64_t
Definition: crtdefs.h:376