|
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 #ifdef __MSVCRT__ |
|
424 _CRTIMP __int64 __cdecl __MINGW_NOTHROW _atoi64(const char *); |
|
425 _CRTIMP char* __cdecl __MINGW_NOTHROW _i64toa(__int64, char *, int); |
|
426 _CRTIMP char* __cdecl __MINGW_NOTHROW _ui64toa(unsigned __int64, char *, int); |
|
427 _CRTIMP __int64 __cdecl __MINGW_NOTHROW _wtoi64(const wchar_t *); |
|
428 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _i64tow(__int64, wchar_t *, int); |
|
429 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ui64tow(unsigned __int64, wchar_t *, int); |
|
430 |
|
431 |
|
432 _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _rotl(unsigned int, int) __MINGW_ATTRIB_CONST; |
|
433 _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _rotr(unsigned int, int) __MINGW_ATTRIB_CONST; |
|
434 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotl(unsigned long, int) __MINGW_ATTRIB_CONST; |
|
435 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotr(unsigned long, int) __MINGW_ATTRIB_CONST; |
|
436 |
|
437 _CRTIMP int __cdecl __MINGW_NOTHROW _set_error_mode (int); |
|
438 #define _OUT_TO_DEFAULT 0 |
|
439 #define _OUT_TO_STDERR 1 |
|
440 #define _OUT_TO_MSGBOX 2 |
|
441 #define _REPORT_ERRMODE 3 |
|
442 |
|
443 #if __MSVCRT_VERSION__ >= 0x800 |
|
444 #ifndef _INTPTR_T_DEFINED |
|
445 #define _INTPTR_T_DEFINED |
|
446 #ifdef _WIN64 |
|
447 typedef __int64 intptr_t; |
|
448 #else |
|
449 typedef int intptr_t; |
|
450 #endif |
|
451 #endif |
|
452 _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_abort_behavior (unsigned int, unsigned int); |
|
453 /* These masks work with msvcr80.dll version 8.0.50215.44 (a beta release). */ |
|
454 #define _WRITE_ABORT_MSG 1 |
|
455 #define _CALL_REPORTFAULT 2 |
|
456 |
|
457 typedef void (* _invalid_parameter_handler) (const wchar_t *, |
|
458 const wchar_t *, |
|
459 const wchar_t *, |
|
460 unsigned int, |
|
461 uintptr_t); |
|
462 _invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler); |
|
463 #endif /* __MSVCRT_VERSION__ >= 0x800 */ |
|
464 #endif /* __MSVCRT__ */ |
|
465 |
|
466 #ifndef _NO_OLDNAMES |
|
467 |
|
468 _CRTIMP int __cdecl __MINGW_NOTHROW putenv (const char*); |
|
469 _CRTIMP void __cdecl __MINGW_NOTHROW searchenv (const char*, const char*, char*); |
|
470 |
|
471 _CRTIMP char* __cdecl __MINGW_NOTHROW itoa (int, char*, int); |
|
472 _CRTIMP char* __cdecl __MINGW_NOTHROW ltoa (long, char*, int); |
|
473 |
|
474 #ifndef _UWIN |
|
475 _CRTIMP char* __cdecl __MINGW_NOTHROW ecvt (double, int, int*, int*); |
|
476 _CRTIMP char* __cdecl __MINGW_NOTHROW fcvt (double, int, int*, int*); |
|
477 _CRTIMP char* __cdecl __MINGW_NOTHROW gcvt (double, int, char*); |
|
478 #endif /* _UWIN */ |
|
479 #endif /* Not _NO_OLDNAMES */ |
|
480 |
|
481 #endif /* Not __STRICT_ANSI__ */ |
|
482 |
|
483 /* C99 names */ |
|
484 |
|
485 #if !defined __NO_ISOCEXT /* externs in static libmingwex.a */ |
|
486 |
|
487 /* C99 name for _exit */ |
|
488 void __cdecl __MINGW_NOTHROW _Exit(int) __MINGW_ATTRIB_NORETURN; |
|
489 #ifndef __STRICT_ANSI__ /* inline using non-ansi functions */ |
|
490 __CRT_INLINE void __cdecl __MINGW_NOTHROW _Exit(int __status) |
|
491 { _exit (__status); } |
|
492 #endif |
|
493 |
|
494 typedef struct { long long quot, rem; } lldiv_t; |
|
495 |
|
496 lldiv_t __cdecl __MINGW_NOTHROW lldiv (long long, long long) __MINGW_ATTRIB_CONST; |
|
497 |
|
498 long long __cdecl __MINGW_NOTHROW llabs(long long); |
|
499 __CRT_INLINE long long __cdecl __MINGW_NOTHROW llabs(long long _j) |
|
500 {return (_j >= 0 ? _j : -_j);} |
|
501 |
|
502 long long __cdecl __MINGW_NOTHROW strtoll (const char* __restrict__, char** __restrict, int); |
|
503 unsigned long long __cdecl __MINGW_NOTHROW strtoull (const char* __restrict__, char** __restrict__, int); |
|
504 |
|
505 #if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */ |
|
506 long long __cdecl __MINGW_NOTHROW atoll (const char *); |
|
507 |
|
508 #if !defined (__STRICT_ANSI__) |
|
509 long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t *); |
|
510 char* __cdecl __MINGW_NOTHROW lltoa (long long, char *, int); |
|
511 char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long , char *, int); |
|
512 wchar_t* __cdecl __MINGW_NOTHROW lltow (long long, wchar_t *, int); |
|
513 wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long, wchar_t *, int); |
|
514 |
|
515 /* inline using non-ansi functions */ |
|
516 __CRT_INLINE long long __cdecl __MINGW_NOTHROW atoll (const char * _c) |
|
517 { return _atoi64 (_c); } |
|
518 __CRT_INLINE char* __cdecl __MINGW_NOTHROW lltoa (long long _n, char * _c, int _i) |
|
519 { return _i64toa (_n, _c, _i); } |
|
520 __CRT_INLINE char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long _n, char * _c, int _i) |
|
521 { return _ui64toa (_n, _c, _i); } |
|
522 __CRT_INLINE long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t * _w) |
|
523 { return _wtoi64 (_w); } |
|
524 __CRT_INLINE wchar_t* __cdecl __MINGW_NOTHROW lltow (long long _n, wchar_t * _w, int _i) |
|
525 { return _i64tow (_n, _w, _i); } |
|
526 __CRT_INLINE wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, int _i) |
|
527 { return _ui64tow (_n, _w, _i); } |
|
528 #endif /* (__STRICT_ANSI__) */ |
|
529 |
|
530 #endif /* __MSVCRT__ */ |
|
531 |
|
532 #endif /* !__NO_ISOCEXT */ |
|
533 |
|
534 |
|
535 #ifdef __cplusplus |
|
536 } |
|
537 #endif |
|
538 |
|
539 #endif /* Not RC_INVOKED */ |
|
540 |
|
541 #endif /* Not _STDLIB_H_ */ |
|
542 |