The real, definitive, Visual C++ support branch. Accept no substitutes
[reactos.git] / include / crt / stdlib.h
1 /*
2 * stdlib.h
3 * This file has no copyright assigned and is placed in the Public Domain.
4 * This file is a part of the mingw-runtime package.
5 * No warranty is given; refer to the file DISCLAIMER within the package.
6 *
7 * Definitions for common types, variables, and functions.
8 *
9 */
10
11 #ifndef _STDLIB_H_
12 #define _STDLIB_H_
13
14 /* All the headers include this file. */
15 #include <_mingw.h>
16
17 #define __need_size_t
18 #define __need_wchar_t
19 #define __need_NULL
20 #ifndef RC_INVOKED
21 #include <stddef.h>
22 #endif /* RC_INVOKED */
23
24 /*
25 * RAND_MAX is the maximum value that may be returned by rand.
26 * The minimum is zero.
27 */
28 #define RAND_MAX 0x7FFF
29
30 /*
31 * These values may be used as exit status codes.
32 */
33 #define EXIT_SUCCESS 0
34 #define EXIT_FAILURE 1
35
36 /*
37 * Definitions for path name functions.
38 * NOTE: All of these values have simply been chosen to be conservatively high.
39 * Remember that with long file names we can no longer depend on
40 * extensions being short.
41 */
42 #ifndef __STRICT_ANSI__
43
44 #ifndef MAX_PATH
45 #define MAX_PATH (260)
46 #endif
47
48 #define _MAX_PATH MAX_PATH
49 #define _MAX_DRIVE (3)
50 #define _MAX_DIR 256
51 #define _MAX_FNAME 256
52 #define _MAX_EXT 256
53
54 #endif /* Not __STRICT_ANSI__ */
55
56
57 #ifndef RC_INVOKED
58
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62
63 #if !defined (__STRICT_ANSI__)
64
65 /*
66 * This seems like a convenient place to declare these variables, which
67 * give programs using WinMain (or main for that matter) access to main-ish
68 * argc and argv. environ is a pointer to a table of environment variables.
69 * NOTE: Strings in _argv and environ are ANSI strings.
70 */
71 extern int _argc;
72 extern char** _argv;
73
74 /* imports from runtime dll of the above variables */
75 #ifdef __MSVCRT__
76
77 extern int* __cdecl __MINGW_NOTHROW __p___argc(void);
78 extern char*** __cdecl __MINGW_NOTHROW __p___argv(void);
79 extern wchar_t*** __cdecl __MINGW_NOTHROW __p___wargv(void);
80
81 #define __argc (*__p___argc())
82 #define __argv (*__p___argv())
83 #define __wargv (*__p___wargv())
84
85 #else /* !MSVCRT */
86
87 #ifndef __DECLSPEC_SUPPORTED
88
89 extern int* _imp____argc_dll;
90 extern char*** _imp____argv_dll;
91 #define __argc (*_imp____argc_dll)
92 #define __argv (*_imp____argv_dll)
93
94 #else /* __DECLSPEC_SUPPORTED */
95
96 __MINGW_IMPORT int __argc_dll;
97 __MINGW_IMPORT char** __argv_dll;
98 #define __argc __argc_dll
99 #define __argv __argv_dll
100
101 #endif /* __DECLSPEC_SUPPORTED */
102
103 #endif /* __MSVCRT */
104 #endif /* __STRICT_ANSI__ */
105 /*
106 * Also defined in ctype.h.
107 */
108 #ifndef MB_CUR_MAX
109 #ifdef __DECLSPEC_SUPPORTED
110 # ifdef __MSVCRT__
111 # define MB_CUR_MAX __mb_cur_max
112 __MINGW_IMPORT int __mb_cur_max;
113 # else /* not __MSVCRT */
114 # define MB_CUR_MAX __mb_cur_max_dll
115 __MINGW_IMPORT int __mb_cur_max_dll;
116 # endif /* not __MSVCRT */
117
118 #else /* ! __DECLSPEC_SUPPORTED */
119 # ifdef __MSVCRT__
120 extern int* _imp____mbcur_max;
121 # define MB_CUR_MAX (*_imp____mb_cur_max)
122 # else /* not __MSVCRT */
123 extern int* _imp____mbcur_max_dll;
124 # define MB_CUR_MAX (*_imp____mb_cur_max_dll)
125 # endif /* not __MSVCRT */
126 #endif /* __DECLSPEC_SUPPORTED */
127 #endif /* MB_CUR_MAX */
128
129 /*
130 * MS likes to declare errno in stdlib.h as well.
131 */
132
133 #ifdef _UWIN
134 #undef errno
135 extern int errno;
136 #else
137 _CRTIMP int* __cdecl __MINGW_NOTHROW _errno(void);
138 #define errno (*_errno())
139 #endif
140 _CRTIMP int* __cdecl __MINGW_NOTHROW __doserrno(void);
141 #define _doserrno (*__doserrno())
142
143 #if !defined (__STRICT_ANSI__)
144 /*
145 * Use environ from the DLL, not as a global.
146 */
147
148 #ifdef __MSVCRT__
149 extern _CRTIMP char *** __cdecl __MINGW_NOTHROW __p__environ(void);
150 extern _CRTIMP wchar_t *** __cdecl __MINGW_NOTHROW __p__wenviron(void);
151 # define _environ (*__p__environ())
152 # define _wenviron (*__p__wenviron())
153 #else /* ! __MSVCRT__ */
154 # ifndef __DECLSPEC_SUPPORTED
155 extern char *** _imp___environ_dll;
156 # define _environ (*_imp___environ_dll)
157 # else /* __DECLSPEC_SUPPORTED */
158 __MINGW_IMPORT char ** _environ_dll;
159 # define _environ _environ_dll
160 # endif /* __DECLSPEC_SUPPORTED */
161 #endif /* ! __MSVCRT__ */
162
163 #define environ _environ
164
165 #ifdef __MSVCRT__
166 /* One of the MSVCRTxx libraries */
167
168 #ifndef __DECLSPEC_SUPPORTED
169 extern int* _imp___sys_nerr;
170 # define sys_nerr (*_imp___sys_nerr)
171 #else /* __DECLSPEC_SUPPORTED */
172 __MINGW_IMPORT int _sys_nerr;
173 # ifndef _UWIN
174 # define sys_nerr _sys_nerr
175 # endif /* _UWIN */
176 #endif /* __DECLSPEC_SUPPORTED */
177
178 #else /* ! __MSVCRT__ */
179
180 /* CRTDLL run time library */
181
182 #ifndef __DECLSPEC_SUPPORTED
183 extern int* _imp___sys_nerr_dll;
184 # define sys_nerr (*_imp___sys_nerr_dll)
185 #else /* __DECLSPEC_SUPPORTED */
186 __MINGW_IMPORT int _sys_nerr_dll;
187 # define sys_nerr _sys_nerr_dll
188 #endif /* __DECLSPEC_SUPPORTED */
189
190 #endif /* ! __MSVCRT__ */
191
192 #ifndef __DECLSPEC_SUPPORTED
193 extern char*** _imp__sys_errlist;
194 #define sys_errlist (*_imp___sys_errlist)
195 #else /* __DECLSPEC_SUPPORTED */
196 __MINGW_IMPORT char* _sys_errlist[];
197 #ifndef _UWIN
198 #define sys_errlist _sys_errlist
199 #endif /* _UWIN */
200 #endif /* __DECLSPEC_SUPPORTED */
201
202 /*
203 * OS version and such constants.
204 */
205
206 #ifdef __MSVCRT__
207 /* msvcrtxx.dll */
208
209 extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__osver(void);
210 extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winver(void);
211 extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winmajor(void);
212 extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winminor(void);
213
214 #ifndef __DECLSPEC_SUPPORTED
215 # define _osver (*__p__osver())
216 # define _winver (*__p__winver())
217 # define _winmajor (*__p__winmajor())
218 # define _winminor (*__p__winminor())
219 #else
220 __MINGW_IMPORT unsigned int _osver;
221 __MINGW_IMPORT unsigned int _winver;
222 __MINGW_IMPORT unsigned int _winmajor;
223 __MINGW_IMPORT unsigned int _winminor;
224 #endif /* __DECLSPEC_SUPPORTED */
225
226 #else
227 /* Not msvcrtxx.dll, thus crtdll.dll */
228
229 #ifndef __DECLSPEC_SUPPORTED
230
231 extern unsigned int* _imp___osver_dll;
232 extern unsigned int* _imp___winver_dll;
233 extern unsigned int* _imp___winmajor_dll;
234 extern unsigned int* _imp___winminor_dll;
235
236 #define _osver (*_imp___osver_dll)
237 #define _winver (*_imp___winver_dll)
238 #define _winmajor (*_imp___winmajor_dll)
239 #define _winminor (*_imp___winminor_dll)
240
241 #else /* __DECLSPEC_SUPPORTED */
242
243 __MINGW_IMPORT unsigned int _osver_dll;
244 __MINGW_IMPORT unsigned int _winver_dll;
245 __MINGW_IMPORT unsigned int _winmajor_dll;
246 __MINGW_IMPORT unsigned int _winminor_dll;
247
248 #define _osver _osver_dll
249 #define _winver _winver_dll
250 #define _winmajor _winmajor_dll
251 #define _winminor _winminor_dll
252
253 #endif /* __DECLSPEC_SUPPORTED */
254
255 #endif
256
257 #if defined __MSVCRT__
258 /* although the _pgmptr is exported as DATA,
259 * be safe and use the access function __p__pgmptr() to get it. */
260 _CRTIMP char** __cdecl __MINGW_NOTHROW __p__pgmptr(void);
261 #define _pgmptr (*__p__pgmptr())
262 _CRTIMP wchar_t** __cdecl __MINGW_NOTHROW __p__wpgmptr(void);
263 #define _wpgmptr (*__p__wpgmptr())
264 #else /* ! __MSVCRT__ */
265 # ifndef __DECLSPEC_SUPPORTED
266 extern char** __imp__pgmptr_dll;
267 # define _pgmptr (*_imp___pgmptr_dll)
268 # else /* __DECLSPEC_SUPPORTED */
269 __MINGW_IMPORT char* _pgmptr_dll;
270 # define _pgmptr _pgmptr_dll
271 # endif /* __DECLSPEC_SUPPORTED */
272 /* no wide version in CRTDLL */
273 #endif /* __MSVCRT__ */
274
275 /*
276 * This variable determines the default file mode.
277 * TODO: Which flags work?
278 */
279 #if !defined (__DECLSPEC_SUPPORTED) || defined (__IN_MINGW_RUNTIME)
280
281 #ifdef __MSVCRT__
282 extern int* _imp___fmode;
283 #define _fmode (*_imp___fmode)
284 #else
285 /* CRTDLL */
286 extern int* _imp___fmode_dll;
287 #define _fmode (*_imp___fmode_dll)
288 #endif
289
290 #else /* __DECLSPEC_SUPPORTED */
291
292 #ifdef __MSVCRT__
293 __MINGW_IMPORT int _fmode;
294 #else /* ! __MSVCRT__ */
295 __MINGW_IMPORT int _fmode_dll;
296 #define _fmode _fmode_dll
297 #endif /* ! __MSVCRT__ */
298
299 #endif /* __DECLSPEC_SUPPORTED */
300
301 #endif /* Not __STRICT_ANSI__ */
302
303 _CRTIMP double __cdecl __MINGW_NOTHROW atof (const char*);
304 _CRTIMP int __cdecl __MINGW_NOTHROW atoi (const char*);
305 _CRTIMP long __cdecl __MINGW_NOTHROW atol (const char*);
306 #if !defined (__STRICT_ANSI__)
307 _CRTIMP int __cdecl __MINGW_NOTHROW _wtoi (const wchar_t *);
308 _CRTIMP long __cdecl __MINGW_NOTHROW _wtol (const wchar_t *);
309 #endif
310 _CRTIMP double __cdecl __MINGW_NOTHROW strtod (const char*, char**);
311 #if !defined __NO_ISOCEXT /* in libmingwex.a */
312 float __cdecl __MINGW_NOTHROW strtof (const char * __restrict__, char ** __restrict__);
313 long double __cdecl __MINGW_NOTHROW strtold (const char * __restrict__, char ** __restrict__);
314 #endif /* __NO_ISOCEXT */
315
316 _CRTIMP long __cdecl __MINGW_NOTHROW strtol (const char*, char**, int);
317 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW strtoul (const char*, char**, int);
318
319 #ifndef _WSTDLIB_DEFINED
320 /* also declared in wchar.h */
321 _CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t*, wchar_t**, int);
322 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int);
323 _CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**);
324 #if !defined __NO_ISOCEXT /* in libmingwex.a */
325 float __cdecl __MINGW_NOTHROW wcstof( const wchar_t * __restrict__, wchar_t ** __restrict__);
326 long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
327 #endif /* __NO_ISOCEXT */
328 #ifdef __MSVCRT__
329 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*);
330 _CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*);
331 _CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
332 _CRTIMP int __cdecl __MINGW_NOTHROW _wsystem(const wchar_t*);
333 _CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
334 _CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
335 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t);
336 #endif
337 #define _WSTDLIB_DEFINED
338 #endif
339
340 _CRTIMP size_t __cdecl __MINGW_NOTHROW wcstombs (char*, const wchar_t*, size_t);
341 _CRTIMP int __cdecl __MINGW_NOTHROW wctomb (char*, wchar_t);
342
343 _CRTIMP int __cdecl __MINGW_NOTHROW mblen (const char*, size_t);
344 _CRTIMP size_t __cdecl __MINGW_NOTHROW mbstowcs (wchar_t*, const char*, size_t);
345 _CRTIMP int __cdecl __MINGW_NOTHROW mbtowc (wchar_t*, const char*, size_t);
346
347 _CRTIMP int __cdecl __MINGW_NOTHROW rand (void);
348 _CRTIMP void __cdecl __MINGW_NOTHROW srand (unsigned int);
349
350 _CRTIMP void* __cdecl __MINGW_NOTHROW calloc (size_t, size_t) __MINGW_ATTRIB_MALLOC;
351 _CRTIMP void* __cdecl __MINGW_NOTHROW malloc (size_t) __MINGW_ATTRIB_MALLOC;
352 _CRTIMP void* __cdecl __MINGW_NOTHROW realloc (void*, size_t);
353 _CRTIMP void __cdecl __MINGW_NOTHROW free (void*);
354 _CRTIMP void __cdecl __MINGW_NOTHROW abort (void) __MINGW_ATTRIB_NORETURN;
355 _CRTIMP void __cdecl __MINGW_NOTHROW exit (int) __MINGW_ATTRIB_NORETURN;
356
357 /* Note: This is in startup code, not imported directly from dll */
358 int __cdecl __MINGW_NOTHROW atexit (void (*)(void));
359
360 _CRTIMP int __cdecl __MINGW_NOTHROW system (const char*);
361 _CRTIMP char* __cdecl __MINGW_NOTHROW getenv (const char*);
362
363 /* bsearch and qsort are also in non-ANSI header search.h */
364 _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t,
365 int (*)(const void*, const void*));
366 _CRTIMP void __cdecl qsort(void*, size_t, size_t,
367 int (*)(const void*, const void*));
368
369 _CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST;
370 _CRTIMP long __cdecl __MINGW_NOTHROW labs (long) __MINGW_ATTRIB_CONST;
371
372 /*
373 * div_t and ldiv_t are structures used to return the results of div and
374 * ldiv.
375 *
376 * NOTE: div and ldiv appear not to work correctly unless
377 * -fno-pcc-struct-return is specified. This is included in the
378 * mingw32 specs file.
379 */
380 typedef struct { int quot, rem; } div_t;
381 typedef struct { long quot, rem; } ldiv_t;
382
383 _CRTIMP div_t __cdecl __MINGW_NOTHROW div (int, int) __MINGW_ATTRIB_CONST;
384 _CRTIMP ldiv_t __cdecl __MINGW_NOTHROW ldiv (long, long) __MINGW_ATTRIB_CONST;
385
386 #if !defined (__STRICT_ANSI__)
387
388 /*
389 * NOTE: Officially the three following functions are obsolete. The Win32 API
390 * functions SetErrorMode, Beep and Sleep are their replacements.
391 */
392 _CRTIMP void __cdecl __MINGW_NOTHROW _beep (unsigned int, unsigned int) __MINGW_ATTRIB_DEPRECATED;
393 /* Not to be confused with _set_error_mode (int). */
394 _CRTIMP void __cdecl __MINGW_NOTHROW _seterrormode (int) __MINGW_ATTRIB_DEPRECATED;
395 _CRTIMP void __cdecl __MINGW_NOTHROW _sleep (unsigned long) __MINGW_ATTRIB_DEPRECATED;
396
397 _CRTIMP void __cdecl __MINGW_NOTHROW _exit (int) __MINGW_ATTRIB_NORETURN;
398
399 /* _onexit is MS extension. Use atexit for portability. */
400 /* Note: This is in startup code, not imported directly from dll */
401 typedef int (* _onexit_t)(void);
402 _onexit_t __cdecl __MINGW_NOTHROW _onexit( _onexit_t );
403
404 _CRTIMP int __cdecl __MINGW_NOTHROW _putenv (const char*);
405 _CRTIMP void __cdecl __MINGW_NOTHROW _searchenv (const char*, const char*, char*);
406
407
408 _CRTIMP char* __cdecl __MINGW_NOTHROW _ecvt (double, int, int*, int*);
409 _CRTIMP char* __cdecl __MINGW_NOTHROW _fcvt (double, int, int*, int*);
410 _CRTIMP char* __cdecl __MINGW_NOTHROW _gcvt (double, int, char*);
411
412 _CRTIMP void __cdecl __MINGW_NOTHROW _makepath (char*, const char*, const char*, const char*, const char*);
413 _CRTIMP void __cdecl __MINGW_NOTHROW _splitpath (const char*, char*, char*, char*, char*);
414 _CRTIMP char* __cdecl __MINGW_NOTHROW _fullpath (char*, const char*, size_t);
415
416 _CRTIMP char* __cdecl __MINGW_NOTHROW _itoa (int, char*, int);
417 _CRTIMP char* __cdecl __MINGW_NOTHROW _ltoa (long, char*, int);
418 _CRTIMP char* __cdecl __MINGW_NOTHROW _ultoa(unsigned long, char*, int);
419 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _itow (int, wchar_t*, int);
420 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ltow (long, wchar_t*, int);
421 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ultow (unsigned long, wchar_t*, int);
422
423 _CRTIMP __int64 __cdecl __MINGW_NOTHROW _atoi64(const char *);
424
425 #ifdef __MSVCRT__
426 _CRTIMP char* __cdecl __MINGW_NOTHROW _i64toa(__int64, char *, int);
427 _CRTIMP char* __cdecl __MINGW_NOTHROW _ui64toa(unsigned __int64, char *, int);
428 _CRTIMP __int64 __cdecl __MINGW_NOTHROW _wtoi64(const wchar_t *);
429 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _i64tow(__int64, wchar_t *, int);
430 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ui64tow(unsigned __int64, wchar_t *, int);
431
432
433 _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _rotl(unsigned int, int) __MINGW_ATTRIB_CONST;
434 _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _rotr(unsigned int, int) __MINGW_ATTRIB_CONST;
435 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotl(unsigned long, int) __MINGW_ATTRIB_CONST;
436 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotr(unsigned long, int) __MINGW_ATTRIB_CONST;
437
438 _CRTIMP int __cdecl __MINGW_NOTHROW _set_error_mode (int);
439 #define _OUT_TO_DEFAULT 0
440 #define _OUT_TO_STDERR 1
441 #define _OUT_TO_MSGBOX 2
442 #define _REPORT_ERRMODE 3
443
444 #if __MSVCRT_VERSION__ >= 0x800
445 #ifndef _INTPTR_T_DEFINED
446 #define _INTPTR_T_DEFINED
447 #ifdef _WIN64
448 typedef __int64 intptr_t;
449 #else
450 typedef int intptr_t;
451 #endif
452 #endif
453 _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_abort_behavior (unsigned int, unsigned int);
454 /* These masks work with msvcr80.dll version 8.0.50215.44 (a beta release). */
455 #define _WRITE_ABORT_MSG 1
456 #define _CALL_REPORTFAULT 2
457
458 typedef void (* _invalid_parameter_handler) (const wchar_t *,
459 const wchar_t *,
460 const wchar_t *,
461 unsigned int,
462 uintptr_t);
463 _invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler);
464 #endif /* __MSVCRT_VERSION__ >= 0x800 */
465 #endif /* __MSVCRT__ */
466
467 #ifndef _NO_OLDNAMES
468
469 _CRTIMP int __cdecl __MINGW_NOTHROW putenv (const char*);
470 _CRTIMP void __cdecl __MINGW_NOTHROW searchenv (const char*, const char*, char*);
471
472 _CRTIMP char* __cdecl __MINGW_NOTHROW itoa (int, char*, int);
473 _CRTIMP char* __cdecl __MINGW_NOTHROW ltoa (long, char*, int);
474
475 #ifndef _UWIN
476 _CRTIMP char* __cdecl __MINGW_NOTHROW ecvt (double, int, int*, int*);
477 _CRTIMP char* __cdecl __MINGW_NOTHROW fcvt (double, int, int*, int*);
478 _CRTIMP char* __cdecl __MINGW_NOTHROW gcvt (double, int, char*);
479 #endif /* _UWIN */
480 #endif /* Not _NO_OLDNAMES */
481
482 #endif /* Not __STRICT_ANSI__ */
483
484 /* C99 names */
485
486 #if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
487
488 /* C99 name for _exit */
489 void __cdecl __MINGW_NOTHROW _Exit(int) __MINGW_ATTRIB_NORETURN;
490 #ifndef __STRICT_ANSI__ /* inline using non-ansi functions */
491 __CRT_INLINE void __cdecl __MINGW_NOTHROW _Exit(int __status)
492 { _exit (__status); }
493 #endif
494
495 typedef struct { long long quot, rem; } lldiv_t;
496
497 lldiv_t __cdecl __MINGW_NOTHROW lldiv (long long, long long) __MINGW_ATTRIB_CONST;
498
499 long long __cdecl __MINGW_NOTHROW llabs(long long);
500 __CRT_INLINE long long __cdecl __MINGW_NOTHROW llabs(long long _j)
501 {return (_j >= 0 ? _j : -_j);}
502
503 long long __cdecl __MINGW_NOTHROW strtoll (const char* __restrict__, char** __restrict, int);
504 unsigned long long __cdecl __MINGW_NOTHROW strtoull (const char* __restrict__, char** __restrict__, int);
505
506 #if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
507 long long __cdecl __MINGW_NOTHROW atoll (const char *);
508
509 #if !defined (__STRICT_ANSI__)
510 long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t *);
511 char* __cdecl __MINGW_NOTHROW lltoa (long long, char *, int);
512 char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long , char *, int);
513 wchar_t* __cdecl __MINGW_NOTHROW lltow (long long, wchar_t *, int);
514 wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long, wchar_t *, int);
515
516 /* inline using non-ansi functions */
517 __CRT_INLINE long long __cdecl __MINGW_NOTHROW atoll (const char * _c)
518 { return _atoi64 (_c); }
519 __CRT_INLINE char* __cdecl __MINGW_NOTHROW lltoa (long long _n, char * _c, int _i)
520 { return _i64toa (_n, _c, _i); }
521 __CRT_INLINE char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long _n, char * _c, int _i)
522 { return _ui64toa (_n, _c, _i); }
523 __CRT_INLINE long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t * _w)
524 { return _wtoi64 (_w); }
525 __CRT_INLINE wchar_t* __cdecl __MINGW_NOTHROW lltow (long long _n, wchar_t * _w, int _i)
526 { return _i64tow (_n, _w, _i); }
527 __CRT_INLINE wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, int _i)
528 { return _ui64tow (_n, _w, _i); }
529 #endif /* (__STRICT_ANSI__) */
530
531 #endif /* __MSVCRT__ */
532
533 #endif /* !__NO_ISOCEXT */
534
535
536 #ifdef __cplusplus
537 }
538 #endif
539
540 #endif /* Not RC_INVOKED */
541
542 #endif /* Not _STDLIB_H_ */
543
544