blob: fec1977a4efeb33dde2c313fd3142bccaef4c14a [file] [log] [blame]
Kai Tietz9d937a72007-08-10 10:41:48 +00001/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
Kai Tietzd42ac882010-01-15 20:17:42 +00004 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
Kai Tietz9d937a72007-08-10 10:41:48 +00005 */
Kai Tietzedaa25e2007-08-23 09:28:16 +00006#ifndef _INC_STDLIB
7#define _INC_STDLIB
8
9#include <_mingw.h>
10#include <limits.h>
11
12#pragma pack(push,_CRT_PACKING)
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#ifndef NULL
19#ifdef __cplusplus
Ozkan Sezerc6f47722009-08-14 19:49:43 +000020#ifndef _WIN64
Kai Tietzedaa25e2007-08-23 09:28:16 +000021#define NULL 0
22#else
Ozkan Sezerc6f47722009-08-14 19:49:43 +000023#define NULL 0LL
24#endif /* W64 */
25#else
Kai Tietzedaa25e2007-08-23 09:28:16 +000026#define NULL ((void *)0)
27#endif
28#endif
29
30#define EXIT_SUCCESS 0
31#define EXIT_FAILURE 1
32
33#ifndef _ONEXIT_T_DEFINED
34#define _ONEXIT_T_DEFINED
35
36 typedef int (__cdecl *_onexit_t)(void);
37
38#ifndef NO_OLDNAMES
39#define onexit_t _onexit_t
40#endif
41#endif
42
43#ifndef _DIV_T_DEFINED
44#define _DIV_T_DEFINED
45
46 typedef struct _div_t {
47 int quot;
48 int rem;
49 } div_t;
50
51 typedef struct _ldiv_t {
52 long quot;
53 long rem;
54 } ldiv_t;
55#endif
56
57#ifndef _CRT_DOUBLE_DEC
Kai Tietzb21eb362007-08-17 09:54:07 +000058#define _CRT_DOUBLE_DEC
Kai Tietzedaa25e2007-08-23 09:28:16 +000059
60#pragma pack(4)
61 typedef struct {
62 unsigned char ld[10];
63 } _LDOUBLE;
64#pragma pack()
65
66#define _PTR_LD(x) ((unsigned char *)(&(x)->ld))
67
68 typedef struct {
69 double x;
70 } _CRT_DOUBLE;
71
72 typedef struct {
73 float f;
74 } _CRT_FLOAT;
75
76#pragma push_macro("long")
77#undef long
78
79 typedef struct {
80 long double x;
81 } _LONGDOUBLE;
82
83#pragma pop_macro("long")
84
85#pragma pack(4)
86 typedef struct {
87 unsigned char ld12[12];
88 } _LDBL12;
89#pragma pack()
90#endif
91
92#define RAND_MAX 0x7fff
93
94#ifndef MB_CUR_MAX
95#define MB_CUR_MAX ___mb_cur_max_func()
96#ifndef __mb_cur_max
Kai Tietzf30b6552008-08-27 11:48:54 +000097#ifdef _MSVCRT_
98 extern int __mb_cur_max;
Ozkan Sezer1b598a82011-05-23 09:33:23 +000099#define __mb_cur_max __mb_cur_max
Kai Tietzf30b6552008-08-27 11:48:54 +0000100#else
Kai Tietz50970832009-03-28 12:35:26 +0000101 extern int * __MINGW_IMP_SYMBOL(__mb_cur_max);
102#define __mb_cur_max (* __MINGW_IMP_SYMBOL(__mb_cur_max))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000103#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000104#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000105#define ___mb_cur_max_func() (__mb_cur_max)
Kai Tietzf30b6552008-08-27 11:48:54 +0000106#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000107
108#define __max(a,b) (((a) > (b)) ? (a) : (b))
109#define __min(a,b) (((a) < (b)) ? (a) : (b))
110
111#define _MAX_PATH 260
112#define _MAX_DRIVE 3
113#define _MAX_DIR 256
114#define _MAX_FNAME 256
115#define _MAX_EXT 256
116
117#define _OUT_TO_DEFAULT 0
118#define _OUT_TO_STDERR 1
119#define _OUT_TO_MSGBOX 2
120#define _REPORT_ERRMODE 3
121
122#define _WRITE_ABORT_MSG 0x1
123#define _CALL_REPORTFAULT 0x2
124
125#define _MAX_ENV 32767
126
127 typedef void (__cdecl *_purecall_handler)(void);
128
129 _CRTIMP _purecall_handler __cdecl _set_purecall_handler(_purecall_handler _Handler);
Kai Tietz401adef2008-10-28 15:12:13 +0000130 _CRTIMP _purecall_handler __cdecl _get_purecall_handler(void);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000131
132 typedef void (__cdecl *_invalid_parameter_handler)(const wchar_t *,const wchar_t *,const wchar_t *,unsigned int,uintptr_t);
133 _invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler _Handler);
134 _invalid_parameter_handler __cdecl _get_invalid_parameter_handler(void);
135
136#ifndef _CRT_ERRNO_DEFINED
137#define _CRT_ERRNO_DEFINED
138 _CRTIMP extern int *__cdecl _errno(void);
139#define errno (*_errno())
140 errno_t __cdecl _set_errno(int _Value);
141 errno_t __cdecl _get_errno(int *_Value);
142#endif
143 _CRTIMP unsigned long *__cdecl __doserrno(void);
144#define _doserrno (*__doserrno())
145 errno_t __cdecl _set_doserrno(unsigned long _Value);
146 errno_t __cdecl _get_doserrno(unsigned long *_Value);
Kai Tietza4c27892008-08-27 13:02:24 +0000147#ifdef _MSVCRT_
148 extern char *_sys_errlist[];
149 extern int _sys_nerr;
150#else
Kai Tietzf78a1052009-01-27 19:23:21 +0000151 extern _CRTIMP char *_sys_errlist[1];
152 extern _CRTIMP int _sys_nerr;
Kai Tietza4c27892008-08-27 13:02:24 +0000153#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000154#if (defined(_X86_) && !defined(__x86_64))
155 _CRTIMP int *__cdecl __p___argc(void);
156 _CRTIMP char ***__cdecl __p___argv(void);
157 _CRTIMP wchar_t ***__cdecl __p___wargv(void);
158 _CRTIMP char ***__cdecl __p__environ(void);
159 _CRTIMP wchar_t ***__cdecl __p__wenviron(void);
160 _CRTIMP char **__cdecl __p__pgmptr(void);
161 _CRTIMP wchar_t **__cdecl __p__wpgmptr(void);
162#endif
163#ifndef __argc
Kai Tietzf30b6552008-08-27 11:48:54 +0000164#ifdef _MSVCRT_
165 extern int __argc;
166#else
Kai Tietz50970832009-03-28 12:35:26 +0000167 extern int * __MINGW_IMP_SYMBOL(__argc);
168#define __argc (* __MINGW_IMP_SYMBOL(__argc))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000169#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000170#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000171#ifndef __argv
Kai Tietzf30b6552008-08-27 11:48:54 +0000172#ifdef _MSVCRT_
173 extern char **__argv;
174#else
Kai Tietz50970832009-03-28 12:35:26 +0000175 extern char *** __MINGW_IMP_SYMBOL(__argv);
176#define __argv (* __MINGW_IMP_SYMBOL(__argv))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000177#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000178#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000179#ifndef __wargv
Kai Tietzf30b6552008-08-27 11:48:54 +0000180#ifdef _MSVCRT_
181 extern wchar_t **__wargv;
182#else
Kai Tietz50970832009-03-28 12:35:26 +0000183 extern wchar_t *** __MINGW_IMP_SYMBOL(__wargv);
184#define __wargv (* __MINGW_IMP_SYMBOL(__wargv))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000185#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000186#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000187
188#ifdef _POSIX_
189 extern char **environ;
190#else
191#ifndef _environ
Kai Tietzf30b6552008-08-27 11:48:54 +0000192#ifdef _MSVCRT_
193 extern char **_environ;
194#else
Kai Tietz50970832009-03-28 12:35:26 +0000195 extern char *** __MINGW_IMP_SYMBOL(_environ);
196#define _environ (* __MINGW_IMP_SYMBOL(_environ))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000197#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000198#endif
199
Kai Tietzedaa25e2007-08-23 09:28:16 +0000200#ifndef _wenviron
Kai Tietzf30b6552008-08-27 11:48:54 +0000201#ifdef _MSVCRT_
202 extern wchar_t **_wenviron;
203#else
Kai Tietz50970832009-03-28 12:35:26 +0000204 extern wchar_t *** __MINGW_IMP_SYMBOL(_wenviron);
205#define _wenviron (* __MINGW_IMP_SYMBOL(_wenviron))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000206#endif
207#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000208#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000209#ifndef _pgmptr
Kai Tietzf30b6552008-08-27 11:48:54 +0000210#ifdef _MSVCRT_
211 extern char *_pgmptr;
212#else
Kai Tietz50970832009-03-28 12:35:26 +0000213 extern char ** __MINGW_IMP_SYMBOL(_pgmptr);
214#define _pgmptr (* __MINGW_IMP_SYMBOL(_pgmptr))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000215#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000216#endif
217
Kai Tietzedaa25e2007-08-23 09:28:16 +0000218#ifndef _wpgmptr
Kai Tietzf30b6552008-08-27 11:48:54 +0000219#ifdef _MSVCRT_
220 extern wchar_t *_wpgmptr;
221#else
Ozkan Sezer5fa85ae2009-03-28 18:03:42 +0000222 extern wchar_t ** __MINGW_IMP_SYMBOL(_wpgmptr);
Kai Tietz50970832009-03-28 12:35:26 +0000223#define _wpgmptr (* __MINGW_IMP_SYMBOL(_wpgmptr))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000224#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000225#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000226 errno_t __cdecl _get_pgmptr(char **_Value);
227 errno_t __cdecl _get_wpgmptr(wchar_t **_Value);
228#ifndef _fmode
Kai Tietzf30b6552008-08-27 11:48:54 +0000229#ifdef _MSVCRT_
230 extern int _fmode;
231#else
Kai Tietz50970832009-03-28 12:35:26 +0000232 extern int * __MINGW_IMP_SYMBOL(_fmode);
233#define _fmode (* __MINGW_IMP_SYMBOL(_fmode))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000234#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000235#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000236 _CRTIMP errno_t __cdecl _set_fmode(int _Mode);
237 _CRTIMP errno_t __cdecl _get_fmode(int *_PMode);
238
239#ifndef _osplatform
Kai Tietzf30b6552008-08-27 11:48:54 +0000240#ifdef _MSVCRT_
241 extern unsigned int _osplatform;
242#else
Kai Tietz50970832009-03-28 12:35:26 +0000243 extern unsigned int * __MINGW_IMP_SYMBOL(_osplatform);
244#define _osplatform (* __MINGW_IMP_SYMBOL(_osplatform))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000245#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000246#endif
247
Kai Tietzedaa25e2007-08-23 09:28:16 +0000248#ifndef _osver
Kai Tietzf30b6552008-08-27 11:48:54 +0000249#ifdef _MSVCRT_
250 extern unsigned int _osver;
251#else
Kai Tietz50970832009-03-28 12:35:26 +0000252 extern unsigned int * __MINGW_IMP_SYMBOL(_osver);
253#define _osver (* __MINGW_IMP_SYMBOL(_osver))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000254#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000255#endif
256
Kai Tietzedaa25e2007-08-23 09:28:16 +0000257#ifndef _winver
Kai Tietzf30b6552008-08-27 11:48:54 +0000258#ifdef _MSVCRT_
259 extern unsigned int _winver;
260#else
Kai Tietz50970832009-03-28 12:35:26 +0000261 extern unsigned int * __MINGW_IMP_SYMBOL(_winver);
262#define _winver (* __MINGW_IMP_SYMBOL(_winver))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000263#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000264#endif
265
Kai Tietzedaa25e2007-08-23 09:28:16 +0000266#ifndef _winmajor
Kai Tietzf30b6552008-08-27 11:48:54 +0000267#ifdef _MSVCRT_
268 extern unsigned int _winmajor;
269#else
Kai Tietz50970832009-03-28 12:35:26 +0000270 extern unsigned int * __MINGW_IMP_SYMBOL(_winmajor);
271#define _winmajor (* __MINGW_IMP_SYMBOL(_winmajor))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000272#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000273#endif
274
Kai Tietzedaa25e2007-08-23 09:28:16 +0000275#ifndef _winminor
Kai Tietzf30b6552008-08-27 11:48:54 +0000276#ifdef _MSVCRT_
277 extern unsigned int _winminor;
278#else
Kai Tietz50970832009-03-28 12:35:26 +0000279 extern unsigned int * __MINGW_IMP_SYMBOL(_winminor);
280#define _winminor (* __MINGW_IMP_SYMBOL(_winminor))
Kai Tietzedaa25e2007-08-23 09:28:16 +0000281#endif
Kai Tietzf30b6552008-08-27 11:48:54 +0000282#endif
283
Kai Tietzedaa25e2007-08-23 09:28:16 +0000284 errno_t __cdecl _get_osplatform(unsigned int *_Value);
285 errno_t __cdecl _get_osver(unsigned int *_Value);
286 errno_t __cdecl _get_winver(unsigned int *_Value);
287 errno_t __cdecl _get_winmajor(unsigned int *_Value);
288 errno_t __cdecl _get_winminor(unsigned int *_Value);
289#ifndef _countof
290#ifndef __cplusplus
291#define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
292#else
293 extern "C++" {
294 template <typename _CountofType,size_t _SizeOfArray> char (*__countof_helper(UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
295#define _countof(_Array) sizeof(*__countof_helper(_Array))
296 }
297#endif
298#endif
299
300#ifndef _CRT_TERMINATE_DEFINED
301#define _CRT_TERMINATE_DEFINED
Kai Tietz642029e2008-12-18 00:57:02 +0000302 void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN;
Kai Tietz7fb6bce2012-06-15 13:45:38 +0000303 void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN;
Kai Tietz8b8f0da2010-07-15 11:49:42 +0000304
Kai Tietzedaa25e2007-08-23 09:28:16 +0000305#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
306 /* C99 function name */
Kai Tietz642029e2008-12-18 00:57:02 +0000307 void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN;
Kai Tietz17f7ecc2009-07-27 07:59:50 +0000308#ifndef __CRT__NO_INLINE
Kai Tietz1ebf60c2008-12-18 20:44:00 +0000309 __CRT_INLINE __MINGW_ATTRIB_NORETURN void __cdecl _Exit(int status)
Kai Tietzedaa25e2007-08-23 09:28:16 +0000310 { _exit(status); }
Kai Tietz17f7ecc2009-07-27 07:59:50 +0000311#endif /* !__CRT__NO_INLINE */
Ozkan Sezeref83ddc2010-07-15 13:26:19 +0000312#endif /* Not __NO_ISOCEXT */
Kai Tietz76627272007-10-12 06:54:59 +0000313
314#pragma push_macro("abort")
315#undef abort
Kai Tietzb501b912008-03-20 09:13:53 +0000316 void __cdecl __declspec(noreturn) abort(void);
Kai Tietz76627272007-10-12 06:54:59 +0000317#pragma pop_macro("abort")
318
Ozkan Sezeref83ddc2010-07-15 13:26:19 +0000319#endif /* _CRT_TERMINATE_DEFINED */
Kai Tietzedaa25e2007-08-23 09:28:16 +0000320
321 _CRTIMP unsigned int __cdecl _set_abort_behavior(unsigned int _Flags,unsigned int _Mask);
322
323#ifndef _CRT_ABS_DEFINED
324#define _CRT_ABS_DEFINED
325 int __cdecl abs(int _X);
326 long __cdecl labs(long _X);
327#endif
328
Kai Tietz12cda482009-09-06 12:02:08 +0000329 __MINGW_EXTENSION __int64 __cdecl _abs64(__int64);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000330 int __cdecl atexit(void (__cdecl *)(void));
331#ifndef _CRT_ATOF_DEFINED
332#define _CRT_ATOF_DEFINED
Kai Tietzd56bc122007-10-18 09:03:49 +0000333 double __cdecl atof(const char *_String);
334 double __cdecl _atof_l(const char *_String,_locale_t _Locale);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000335#endif
Kai Tietz63751b62007-10-29 12:22:14 +0000336 int __cdecl atoi(const char *_Str);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000337 _CRTIMP int __cdecl _atoi_l(const char *_Str,_locale_t _Locale);
Kai Tietz63751b62007-10-29 12:22:14 +0000338 long __cdecl atol(const char *_Str);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000339 _CRTIMP long __cdecl _atol_l(const char *_Str,_locale_t _Locale);
340#ifndef _CRT_ALGO_DEFINED
341#define _CRT_ALGO_DEFINED
Kai Tietz0884bf12007-10-16 12:42:57 +0000342 void *__cdecl bsearch(const void *_Key,const void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
343 void __cdecl qsort(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
Kai Tietzedaa25e2007-08-23 09:28:16 +0000344#endif
345 unsigned short __cdecl _byteswap_ushort(unsigned short _Short);
Jacek Caban59b884a2012-05-25 09:53:37 +0000346 unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
Kai Tietz12cda482009-09-06 12:02:08 +0000347 __MINGW_EXTENSION unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64 _Int64);
Kai Tietz63751b62007-10-29 12:22:14 +0000348 div_t __cdecl div(int _Numerator,int _Denominator);
Jonathan Yong116470f2009-12-03 08:43:40 +0000349 char *__cdecl getenv(const char *_VarName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietzedaa25e2007-08-23 09:28:16 +0000350 _CRTIMP char *__cdecl _itoa(int _Value,char *_Dest,int _Radix);
Jonathan Yong116470f2009-12-03 08:43:40 +0000351 __MINGW_EXTENSION _CRTIMP char *__cdecl _i64toa(__int64 _Val,char *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
352 __MINGW_EXTENSION _CRTIMP char *__cdecl _ui64toa(unsigned __int64 _Val,char *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietz12cda482009-09-06 12:02:08 +0000353 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _atoi64(const char *_String);
354 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _atoi64_l(const char *_String,_locale_t _Locale);
355 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _strtoi64(const char *_String,char **_EndPtr,int _Radix);
356 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _strtoi64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
357 __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _strtoui64(const char *_String,char **_EndPtr,int _Radix);
358 __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
Kai Tietz63751b62007-10-29 12:22:14 +0000359 ldiv_t __cdecl ldiv(long _Numerator,long _Denominator);
Jonathan Yong116470f2009-12-03 08:43:40 +0000360 _CRTIMP char *__cdecl _ltoa(long _Value,char *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietz63751b62007-10-29 12:22:14 +0000361 int __cdecl mblen(const char *_Ch,size_t _MaxCount);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000362 _CRTIMP int __cdecl _mblen_l(const char *_Ch,size_t _MaxCount,_locale_t _Locale);
363 _CRTIMP size_t __cdecl _mbstrlen(const char *_Str);
364 _CRTIMP size_t __cdecl _mbstrlen_l(const char *_Str,_locale_t _Locale);
365 _CRTIMP size_t __cdecl _mbstrnlen(const char *_Str,size_t _MaxCount);
366 _CRTIMP size_t __cdecl _mbstrnlen_l(const char *_Str,size_t _MaxCount,_locale_t _Locale);
Kai Tietzc93f1532010-08-14 10:43:15 +0000367 int __cdecl mbtowc(wchar_t * __restrict__ _DstCh,const char * __restrict__ _SrcCh,size_t _SrcSizeInBytes);
368 _CRTIMP int __cdecl _mbtowc_l(wchar_t * __restrict__ _DstCh,const char * __restrict__ _SrcCh,size_t _SrcSizeInBytes,_locale_t _Locale);
369 size_t __cdecl mbstowcs(wchar_t * __restrict__ _Dest,const char * __restrict__ _Source,size_t _MaxCount);
370 _CRTIMP size_t __cdecl _mbstowcs_l(wchar_t * __restrict__ _Dest,const char * __restrict__ _Source,size_t _MaxCount,_locale_t _Locale);
Kai Tietz63751b62007-10-29 12:22:14 +0000371 int __cdecl rand(void);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000372 _CRTIMP int __cdecl _set_error_mode(int _Mode);
Kai Tietz63751b62007-10-29 12:22:14 +0000373 void __cdecl srand(unsigned int _Seed);
Kai Tietz73598402010-01-15 17:53:15 +0000374#ifdef _CRT_RAND_S
375 _CRTIMP errno_t __cdecl rand_s(unsigned int *randomValue);
376#endif
Kai Tietzc93f1532010-08-14 10:43:15 +0000377 double __cdecl __MINGW_NOTHROW strtod(const char * __restrict__ _Str,char ** __restrict__ _EndPtr);
378 float __cdecl __MINGW_NOTHROW strtof(const char * __restrict__ nptr, char ** __restrict__ endptr);
379 long double __cdecl __MINGW_NOTHROW strtold(const char * __restrict__ , char ** __restrict__ );
Kai Tietz94db0202010-07-10 18:38:20 +0000380#if !defined __NO_ISOCEXT
Kai Tietze348f302010-07-10 18:28:11 +0000381 /* libmingwex.a provides a c99-compliant strtod() exported as __strtod() */
Kai Tietz94db0202010-07-10 18:38:20 +0000382 extern double __cdecl __MINGW_NOTHROW
Kai Tietzc93f1532010-08-14 10:43:15 +0000383 __strtod (const char * __restrict__ , char ** __restrict__);
Kai Tietz94db0202010-07-10 18:38:20 +0000384#ifdef __cplusplus
385__inline__ double __cdecl __MINGW_NOTHROW
Kai Tietzc93f1532010-08-14 10:43:15 +0000386strtod (const char * __restrict__ __nptr, char ** __restrict__ __endptr)
Kai Tietz94db0202010-07-10 18:38:20 +0000387{
388 return __strtod(__nptr, __endptr);
389}
390#endif
Kai Tietze348f302010-07-10 18:28:11 +0000391#define strtod __strtod
Kai Tietz94db0202010-07-10 18:38:20 +0000392#endif /* __NO_ISOCEXT */
393
NightStrikeadb61c92008-04-28 15:49:51 +0000394#if !defined __NO_ISOCEXT /* in libmingwex.a */
Ozkan Sezerc8ed1a42009-04-20 13:48:53 +0000395 float __cdecl __mingw_strtof (const char * __restrict__, char ** __restrict__);
396 long double __cdecl __mingw_strtold(const char * __restrict__, char ** __restrict__);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000397#endif /* __NO_ISOCEXT */
Kai Tietzc93f1532010-08-14 10:43:15 +0000398 _CRTIMP double __cdecl _strtod_l(const char * __restrict__ _Str,char ** __restrict__ _EndPtr,_locale_t _Locale);
399 long __cdecl strtol(const char * __restrict__ _Str,char ** __restrict__ _EndPtr,int _Radix);
400 _CRTIMP long __cdecl _strtol_l(const char * __restrict__ _Str,char ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale);
401 unsigned long __cdecl strtoul(const char * __restrict__ _Str,char ** __restrict__ _EndPtr,int _Radix);
402 _CRTIMP unsigned long __cdecl _strtoul_l(const char * __restrict__ _Str,char ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000403#ifndef _CRT_SYSTEM_DEFINED
404#define _CRT_SYSTEM_DEFINED
Kai Tietz63751b62007-10-29 12:22:14 +0000405 int __cdecl system(const char *_Command);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000406#endif
Jonathan Yong116470f2009-12-03 08:43:40 +0000407 _CRTIMP char *__cdecl _ultoa(unsigned long _Value,char *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
408 int __cdecl wctomb(char *_MbCh,wchar_t _WCh) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
409 _CRTIMP int __cdecl _wctomb_l(char *_MbCh,wchar_t _WCh,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietzc93f1532010-08-14 10:43:15 +0000410 size_t __cdecl wcstombs(char * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
411 _CRTIMP size_t __cdecl _wcstombs_l(char * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _MaxCount,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietzedaa25e2007-08-23 09:28:16 +0000412
413#ifndef _CRT_ALLOCATION_DEFINED
414#define _CRT_ALLOCATION_DEFINED
Kai Tietz6bd90732007-10-15 10:36:06 +0000415 void *__cdecl calloc(size_t _NumOfElements,size_t _SizeOfElements);
416 void __cdecl free(void *_Memory);
417 void *__cdecl malloc(size_t _Size);
418 void *__cdecl realloc(void *_Memory,size_t _NewSize);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000419 _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size);
Kai Tietz60bec772009-09-08 13:06:20 +0000420/* Make sure that X86intrin.h doesn't produce here collisions. */
Kai Tietz973cda42010-04-17 13:16:56 +0000421#if (!defined (_XMMINTRIN_H_INCLUDED) && !defined (_MM_MALLOC_H_INCLUDED)) || defined(_aligned_malloc)
Kai Tietz60bec772009-09-08 13:06:20 +0000422#pragma push_macro("_aligned_free")
423#pragma push_macro("_aligned_malloc")
424#undef _aligned_free
425#undef _aligned_malloc
Kai Tietz677cbe22009-09-08 09:39:55 +0000426 _CRTIMP void __cdecl _aligned_free(void *_Memory);
427 _CRTIMP void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment);
Kai Tietz60bec772009-09-08 13:06:20 +0000428#pragma pop_macro("_aligned_free")
429#pragma pop_macro("_aligned_malloc")
Kai Tietz05683f72010-04-17 12:36:57 +0000430#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000431 _CRTIMP void *__cdecl _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset);
432 _CRTIMP void *__cdecl _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment);
433 _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment);
434 _CRTIMP void *__cdecl _aligned_offset_realloc(void *_Memory,size_t _Size,size_t _Alignment,size_t _Offset);
435 _CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment,size_t _Offset);
436#endif
437
438#ifndef _WSTDLIB_DEFINED
Kai Tietzb21eb362007-08-17 09:54:07 +0000439#define _WSTDLIB_DEFINED
Kai Tietzedaa25e2007-08-23 09:28:16 +0000440
Jonathan Yong116470f2009-12-03 08:43:40 +0000441 _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
442 _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
443 _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietzc93f1532010-08-14 10:43:15 +0000444 double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr);
445 float __cdecl wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr);
Kai Tietz16724082011-02-01 10:34:38 +0000446
447 double __cdecl __mingw_wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr);
448 float __cdecl __mingw_wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr);
449 long double __cdecl __mingw_wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__);
450
NightStrikeadb61c92008-04-28 15:49:51 +0000451#if !defined __NO_ISOCEXT /* in libmingwex.a */
452 float __cdecl wcstof( const wchar_t * __restrict__, wchar_t ** __restrict__);
Kai Tietz63751b62007-10-29 12:22:14 +0000453 long double __cdecl wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000454#endif /* __NO_ISOCEXT */
Kai Tietzc93f1532010-08-14 10:43:15 +0000455 _CRTIMP double __cdecl _wcstod_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,_locale_t _Locale);
456 long __cdecl wcstol(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix);
457 _CRTIMP long __cdecl _wcstol_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale);
458 unsigned long __cdecl wcstoul(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix);
459 _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale);
Jonathan Yong116470f2009-12-03 08:43:40 +0000460 _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietzedaa25e2007-08-23 09:28:16 +0000461#ifndef _CRT_WSYSTEM_DEFINED
462#define _CRT_WSYSTEM_DEFINED
463 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
464#endif
465 _CRTIMP double __cdecl _wtof(const wchar_t *_Str);
466 _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale);
467 _CRTIMP int __cdecl _wtoi(const wchar_t *_Str);
468 _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale);
469 _CRTIMP long __cdecl _wtol(const wchar_t *_Str);
470 _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale);
471
Jonathan Yong116470f2009-12-03 08:43:40 +0000472 __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
473 __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietz12cda482009-09-06 12:02:08 +0000474 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
475 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale);
476 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
477 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
478 __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
479 __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000480#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000481
482#ifndef _POSIX_
483#define _CVTBUFSIZE (309+40)
484 _CRTIMP char *__cdecl _fullpath(char *_FullPath,const char *_Path,size_t _SizeInBytes);
Jonathan Yong116470f2009-12-03 08:43:40 +0000485 _CRTIMP char *__cdecl _ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
486 _CRTIMP char *__cdecl _fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
487 _CRTIMP char *__cdecl _gcvt(double _Val,int _NumOfDigits,char *_DstBuf) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietzedaa25e2007-08-23 09:28:16 +0000488 _CRTIMP int __cdecl _atodbl(_CRT_DOUBLE *_Result,char *_Str);
489 _CRTIMP int __cdecl _atoldbl(_LDOUBLE *_Result,char *_Str);
490 _CRTIMP int __cdecl _atoflt(_CRT_FLOAT *_Result,char *_Str);
491 _CRTIMP int __cdecl _atodbl_l(_CRT_DOUBLE *_Result,char *_Str,_locale_t _Locale);
492 _CRTIMP int __cdecl _atoldbl_l(_LDOUBLE *_Result,char *_Str,_locale_t _Locale);
493 _CRTIMP int __cdecl _atoflt_l(_CRT_FLOAT *_Result,char *_Str,_locale_t _Locale);
Kai Tietz93126332009-08-23 16:52:19 +0000494#pragma push_macro ("_lrotr")
495#pragma push_macro ("_lrotl")
496#undef _lrotr
497#undef _lrotl
498#ifdef __x86_64__
Kai Tietz12cda482009-09-06 12:02:08 +0000499 __MINGW_EXTENSION unsigned long long __cdecl _lrotl(unsigned long long _Val,int _Shift);
500 __MINGW_EXTENSION unsigned long long __cdecl _lrotr(unsigned long long _Val,int _Shift);
Kai Tietz93126332009-08-23 16:52:19 +0000501#else
Kai Tietzedaa25e2007-08-23 09:28:16 +0000502 unsigned long __cdecl _lrotl(unsigned long _Val,int _Shift);
503 unsigned long __cdecl _lrotr(unsigned long _Val,int _Shift);
Kai Tietz93126332009-08-23 16:52:19 +0000504#endif
505#pragma pop_macro ("_lrotl")
506#pragma pop_macro ("_lrotr")
507
Kai Tietzedaa25e2007-08-23 09:28:16 +0000508 _CRTIMP void __cdecl _makepath(char *_Path,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext);
509 _onexit_t __cdecl _onexit(_onexit_t _Func);
510
511#ifndef _CRT_PERROR_DEFINED
512#define _CRT_PERROR_DEFINED
Kai Tietz7fbd8c72007-10-16 14:38:02 +0000513 void __cdecl perror(const char *_ErrMsg);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000514#endif
515 _CRTIMP int __cdecl _putenv(const char *_EnvString);
Kai Tietz93126332009-08-23 16:52:19 +0000516#pragma push_macro ("_rotr64")
517#pragma push_macro ("_rotl64")
518#undef _rotl64
519#undef _rotr64
Kai Tietz12cda482009-09-06 12:02:08 +0000520 __MINGW_EXTENSION unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val,int _Shift);
521 __MINGW_EXTENSION unsigned __int64 __cdecl _rotr64(unsigned __int64 Value,int Shift);
Kai Tietz93126332009-08-23 16:52:19 +0000522#pragma pop_macro ("_rotl64")
523#pragma pop_macro ("_rotr64")
Kai Tietz93126332009-08-23 16:52:19 +0000524#pragma push_macro ("_rotr")
525#pragma push_macro ("_rotl")
526#undef _rotr
527#undef _rotl
Kai Tietzedaa25e2007-08-23 09:28:16 +0000528 unsigned int __cdecl _rotr(unsigned int _Val,int _Shift);
Kai Tietz93126332009-08-23 16:52:19 +0000529 unsigned int __cdecl _rotl(unsigned int _Val,int _Shift);
530#pragma pop_macro ("_rotl")
531#pragma pop_macro ("_rotr")
Kai Tietz12cda482009-09-06 12:02:08 +0000532 __MINGW_EXTENSION unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift);
Jonathan Yong116470f2009-12-03 08:43:40 +0000533 _CRTIMP void __cdecl _searchenv(const char *_Filename,const char *_EnvVar,char *_ResultPath) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
534 _CRTIMP void __cdecl _splitpath(const char *_FullPath,char *_Drive,char *_Dir,char *_Filename,char *_Ext) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietzedaa25e2007-08-23 09:28:16 +0000535 _CRTIMP void __cdecl _swab(char *_Buf1,char *_Buf2,int _SizeInBytes);
536
537#ifndef _WSTDLIBP_DEFINED
538#define _WSTDLIBP_DEFINED
539 _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000540 _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext);
541#ifndef _CRT_WPERROR_DEFINED
542#define _CRT_WPERROR_DEFINED
543 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
544#endif
545 _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString);
Jonathan Yong116470f2009-12-03 08:43:40 +0000546 _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
547 _CRTIMP void __cdecl _wsplitpath(const wchar_t *_FullPath,wchar_t *_Drive,wchar_t *_Dir,wchar_t *_Filename,wchar_t *_Ext) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
Kai Tietzedaa25e2007-08-23 09:28:16 +0000548#endif
549
NightStrike05dc84a2008-04-28 20:19:44 +0000550 _CRTIMP void __cdecl _beep(unsigned _Frequency,unsigned _Duration) __MINGW_ATTRIB_DEPRECATED;
551 /* Not to be confused with _set_error_mode (int). */
552 _CRTIMP void __cdecl _seterrormode(int _Mode) __MINGW_ATTRIB_DEPRECATED;
553 _CRTIMP void __cdecl _sleep(unsigned long _Duration) __MINGW_ATTRIB_DEPRECATED;
Kai Tietzedaa25e2007-08-23 09:28:16 +0000554#endif
555
556#ifndef NO_OLDNAMES
557#ifndef _POSIX_
Kai Tietz77502672007-11-23 10:26:28 +0000558#if 0
Kai Tietzedaa25e2007-08-23 09:28:16 +0000559#ifndef __cplusplus
560#ifndef NOMINMAX
Kai Tietz77502672007-11-23 10:26:28 +0000561#ifndef max
Kai Tietzedaa25e2007-08-23 09:28:16 +0000562#define max(a,b) (((a) > (b)) ? (a) : (b))
Kai Tietz77502672007-11-23 10:26:28 +0000563#endif
564#ifndef min
Kai Tietzedaa25e2007-08-23 09:28:16 +0000565#define min(a,b) (((a) < (b)) ? (a) : (b))
566#endif
567#endif
Kai Tietz77502672007-11-23 10:26:28 +0000568#endif
569#endif
570
Kai Tietzedaa25e2007-08-23 09:28:16 +0000571#define sys_errlist _sys_errlist
572#define sys_nerr _sys_nerr
573#define environ _environ
Jonathan Yongff428b32009-10-16 12:19:21 +0000574 char *__cdecl ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
575 char *__cdecl fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
576 char *__cdecl gcvt(double _Val,int _NumOfDigits,char *_DstBuf) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
577 char *__cdecl itoa(int _Val,char *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
578 char *__cdecl ltoa(long _Val,char *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
579 int __cdecl putenv(const char *_EnvString) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
Jonathan Yong185fce02011-05-05 00:46:56 +0000580
581#ifndef _CRT_SWAB_DEFINED
582#define _CRT_SWAB_DEFINED /* Also in unistd.h */
Jonathan Yongff428b32009-10-16 12:19:21 +0000583 void __cdecl swab(char *_Buf1,char *_Buf2,int _SizeInBytes) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
Jonathan Yong185fce02011-05-05 00:46:56 +0000584#endif
585
Jonathan Yongff428b32009-10-16 12:19:21 +0000586 char *__cdecl ultoa(unsigned long _Val,char *_Dstbuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
Kai Tietzedaa25e2007-08-23 09:28:16 +0000587 onexit_t __cdecl onexit(onexit_t _Func);
588#endif
589#endif
590
591#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
592
Kai Tietz12cda482009-09-06 12:02:08 +0000593 typedef struct { __MINGW_EXTENSION long long quot, rem; } lldiv_t;
Kai Tietzedaa25e2007-08-23 09:28:16 +0000594
Kai Tietz12cda482009-09-06 12:02:08 +0000595 __MINGW_EXTENSION lldiv_t __cdecl lldiv(long long, long long);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000596
Kai Tietz12cda482009-09-06 12:02:08 +0000597 __MINGW_EXTENSION long long __cdecl llabs(long long);
Kai Tietz17f7ecc2009-07-27 07:59:50 +0000598#ifndef __CRT__NO_INLINE
Kai Tietz12cda482009-09-06 12:02:08 +0000599 __MINGW_EXTENSION __CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); }
Kai Tietz17f7ecc2009-07-27 07:59:50 +0000600#endif
Kai Tietzedaa25e2007-08-23 09:28:16 +0000601
Kai Tietzc93f1532010-08-14 10:43:15 +0000602 __MINGW_EXTENSION long long __cdecl strtoll(const char * __restrict__, char ** __restrict, int);
603 __MINGW_EXTENSION unsigned long long __cdecl strtoull(const char * __restrict__, char ** __restrict__, int);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000604
Kai Tietz05029842007-11-19 15:18:40 +0000605 /* these are stubs for MS _i64 versions */
Kai Tietz12cda482009-09-06 12:02:08 +0000606 __MINGW_EXTENSION long long __cdecl atoll (const char *);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000607
608#ifndef __STRICT_ANSI__
Kai Tietz12cda482009-09-06 12:02:08 +0000609 __MINGW_EXTENSION long long __cdecl wtoll (const wchar_t *);
610 __MINGW_EXTENSION char *__cdecl lltoa (long long, char *, int);
611 __MINGW_EXTENSION char *__cdecl ulltoa (unsigned long long , char *, int);
612 __MINGW_EXTENSION wchar_t *__cdecl lltow (long long, wchar_t *, int);
613 __MINGW_EXTENSION wchar_t *__cdecl ulltow (unsigned long long, wchar_t *, int);
Kai Tietzedaa25e2007-08-23 09:28:16 +0000614
615 /* __CRT_INLINE using non-ansi functions */
Kai Tietz17f7ecc2009-07-27 07:59:50 +0000616#ifndef __CRT__NO_INLINE
Kai Tietz12cda482009-09-06 12:02:08 +0000617 __MINGW_EXTENSION __CRT_INLINE long long __cdecl atoll (const char * _c) { return _atoi64 (_c); }
618 __MINGW_EXTENSION __CRT_INLINE char *__cdecl lltoa (long long _n, char * _c, int _i) { return _i64toa (_n, _c, _i); }
619 __MINGW_EXTENSION __CRT_INLINE char *__cdecl ulltoa (unsigned long long _n, char * _c, int _i) { return _ui64toa (_n, _c, _i); }
620 __MINGW_EXTENSION __CRT_INLINE long long __cdecl wtoll (const wchar_t * _w) { return _wtoi64 (_w); }
621 __MINGW_EXTENSION __CRT_INLINE wchar_t *__cdecl lltow (long long _n, wchar_t * _w, int _i) { return _i64tow (_n, _w, _i); }
622 __MINGW_EXTENSION __CRT_INLINE wchar_t *__cdecl ulltow (unsigned long long _n, wchar_t * _w, int _i) { return _ui64tow (_n, _w, _i); }
Kai Tietz17f7ecc2009-07-27 07:59:50 +0000623#endif /* !__CRT__NO_INLINE */
Kai Tietzedaa25e2007-08-23 09:28:16 +0000624#endif /* (__STRICT_ANSI__) */
625
626#endif /* !__NO_ISOCEXT */
627
628#ifdef __cplusplus
629}
630#endif
631
632#pragma pack(pop)
Kai Tietz9b530d52007-10-16 15:02:01 +0000633
Kai Tietz65685192007-10-18 13:23:49 +0000634#include <sec_api/stdlib_s.h>
Kai Tietz05029842007-11-19 15:18:40 +0000635#include <malloc.h>
Kai Tietz9b530d52007-10-16 15:02:01 +0000636
Kai Tietzedaa25e2007-08-23 09:28:16 +0000637#endif