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.
7 * Definitions for common types, variables, and functions.
14 /* All the headers include this file. */
18 #define __need_wchar_t
23 #endif /* RC_INVOKED */
26 * RAND_MAX is the maximum value that may be returned by rand.
27 * The minimum is zero.
29 #define RAND_MAX 0x7FFF
32 * These values may be used as exit status codes.
34 #define EXIT_SUCCESS 0
35 #define EXIT_FAILURE 1
38 * Definitions for path name functions.
39 * NOTE: All of these values have simply been chosen to be conservatively high.
40 * Remember that with long file names we can no longer depend on
41 * extensions being short.
43 #ifndef __STRICT_ANSI__
46 #define MAX_PATH (260)
49 #define _MAX_PATH MAX_PATH
50 #define _MAX_DRIVE (3)
52 #define _MAX_FNAME 256
55 #endif /* Not __STRICT_ANSI__ */
62 #if !defined (__STRICT_ANSI__)
65 * This seems like a convenient place to declare these variables, which
66 * give programs using WinMain (or main for that matter) access to main-ish
67 * argc and argv. environ is a pointer to a table of environment variables.
68 * NOTE: Strings in _argv and environ are ANSI strings.
73 /* imports from runtime dll of the above variables */
76 extern int* __cdecl __MINGW_NOTHROW __p___argc(void);
77 extern char*** __cdecl __MINGW_NOTHROW __p___argv(void);
78 extern wchar_t*** __cdecl __MINGW_NOTHROW __p___wargv(void);
80 #define __argc (*__p___argc())
81 #define __argv (*__p___argv())
82 #define __wargv (*__p___wargv())
86 #ifndef __DECLSPEC_SUPPORTED
88 extern int* _imp____argc_dll;
89 extern char*** _imp____argv_dll;
90 #define __argc (*_imp____argc_dll)
91 #define __argv (*_imp____argv_dll)
93 #else /* __DECLSPEC_SUPPORTED */
95 __MINGW_IMPORT int __argc_dll;
96 __MINGW_IMPORT char** __argv_dll;
97 #define __argc __argc_dll
98 #define __argv __argv_dll
100 #endif /* __DECLSPEC_SUPPORTED */
102 #endif /* __MSVCRT */
103 #endif /* __STRICT_ANSI__ */
105 * Also defined in ctype.h.
108 #ifdef __DECLSPEC_SUPPORTED
110 # define MB_CUR_MAX __mb_cur_max
111 __MINGW_IMPORT int __mb_cur_max;
112 # else /* not __MSVCRT */
113 # define MB_CUR_MAX __mb_cur_max_dll
114 __MINGW_IMPORT int __mb_cur_max_dll;
115 # endif /* not __MSVCRT */
117 #else /* ! __DECLSPEC_SUPPORTED */
119 extern int* _imp____mb_cur_max;
120 # define MB_CUR_MAX (*_imp____mb_cur_max)
121 # else /* not __MSVCRT */
122 extern int* _imp____mb_cur_max_dll;
123 # define MB_CUR_MAX (*_imp____mb_cur_max_dll)
124 # endif /* not __MSVCRT */
125 #endif /* __DECLSPEC_SUPPORTED */
126 #endif /* MB_CUR_MAX */
129 * MS likes to declare errno in stdlib.h as well.
136 _CRTIMP int* __cdecl __MINGW_NOTHROW _errno(void);
137 #define errno (*_errno())
139 _CRTIMP int* __cdecl __MINGW_NOTHROW __doserrno(void);
140 #define _doserrno (*__doserrno())
142 #if !defined (__STRICT_ANSI__)
144 * Use environ from the DLL, not as a global.
148 extern _CRTIMP char *** __cdecl __MINGW_NOTHROW __p__environ(void);
149 extern _CRTIMP wchar_t *** __cdecl __MINGW_NOTHROW __p__wenviron(void);
150 # define _environ (*__p__environ())
151 # define _wenviron (*__p__wenviron())
152 #else /* ! __MSVCRT__ */
153 # ifndef __DECLSPEC_SUPPORTED
154 extern char *** _imp___environ_dll;
155 # define _environ (*_imp___environ_dll)
156 # else /* __DECLSPEC_SUPPORTED */
157 __MINGW_IMPORT char ** _environ_dll;
158 # define _environ _environ_dll
159 # endif /* __DECLSPEC_SUPPORTED */
160 #endif /* ! __MSVCRT__ */
162 #define environ _environ
165 /* One of the MSVCRTxx libraries */
167 #ifndef __DECLSPEC_SUPPORTED
168 extern int* _imp___sys_nerr;
169 # define sys_nerr (*_imp___sys_nerr)
170 #else /* __DECLSPEC_SUPPORTED */
171 __MINGW_IMPORT int _sys_nerr;
173 # define sys_nerr _sys_nerr
175 #endif /* __DECLSPEC_SUPPORTED */
177 #else /* ! __MSVCRT__ */
179 /* CRTDLL run time library */
181 #ifndef __DECLSPEC_SUPPORTED
182 extern int* _imp___sys_nerr_dll;
183 # define sys_nerr (*_imp___sys_nerr_dll)
184 #else /* __DECLSPEC_SUPPORTED */
185 __MINGW_IMPORT int _sys_nerr_dll;
186 # define sys_nerr _sys_nerr_dll
187 #endif /* __DECLSPEC_SUPPORTED */
189 #endif /* ! __MSVCRT__ */
191 #ifndef __DECLSPEC_SUPPORTED
192 extern char*** _imp__sys_errlist;
193 #define sys_errlist (*_imp___sys_errlist)
194 #else /* __DECLSPEC_SUPPORTED */
195 __MINGW_IMPORT char* _sys_errlist[];
197 #define sys_errlist _sys_errlist
199 #endif /* __DECLSPEC_SUPPORTED */
202 * OS version and such constants.
208 extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__osver(void);
209 extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winver(void);
210 extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winmajor(void);
211 extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winminor(void);
213 #ifndef __DECLSPEC_SUPPORTED
214 # define _osver (*__p__osver())
215 # define _winver (*__p__winver())
216 # define _winmajor (*__p__winmajor())
217 # define _winminor (*__p__winminor())
219 __MINGW_IMPORT unsigned int _osver;
220 __MINGW_IMPORT unsigned int _winver;
221 __MINGW_IMPORT unsigned int _winmajor;
222 __MINGW_IMPORT unsigned int _winminor;
223 #endif /* __DECLSPEC_SUPPORTED */
226 /* Not msvcrtxx.dll, thus crtdll.dll */
228 #ifndef __DECLSPEC_SUPPORTED
230 extern unsigned int* _imp___osver_dll;
231 extern unsigned int* _imp___winver_dll;
232 extern unsigned int* _imp___winmajor_dll;
233 extern unsigned int* _imp___winminor_dll;
235 #define _osver (*_imp___osver_dll)
236 #define _winver (*_imp___winver_dll)
237 #define _winmajor (*_imp___winmajor_dll)
238 #define _winminor (*_imp___winminor_dll)
240 #else /* __DECLSPEC_SUPPORTED */
242 __MINGW_IMPORT unsigned int _osver_dll;
243 __MINGW_IMPORT unsigned int _winver_dll;
244 __MINGW_IMPORT unsigned int _winmajor_dll;
245 __MINGW_IMPORT unsigned int _winminor_dll;
247 #define _osver _osver_dll
248 #define _winver _winver_dll
249 #define _winmajor _winmajor_dll
250 #define _winminor _winminor_dll
252 #endif /* __DECLSPEC_SUPPORTED */
256 #if defined __MSVCRT__
257 /* although the _pgmptr is exported as DATA,
258 * be safe and use the access function __p__pgmptr() to get it. */
259 _CRTIMP char** __cdecl __MINGW_NOTHROW __p__pgmptr(void);
260 #define _pgmptr (*__p__pgmptr())
261 _CRTIMP wchar_t** __cdecl __MINGW_NOTHROW __p__wpgmptr(void);
262 #define _wpgmptr (*__p__wpgmptr())
263 #else /* ! __MSVCRT__ */
264 # ifndef __DECLSPEC_SUPPORTED
265 extern char** __imp__pgmptr_dll;
266 # define _pgmptr (*_imp___pgmptr_dll)
267 # else /* __DECLSPEC_SUPPORTED */
268 __MINGW_IMPORT char* _pgmptr_dll;
269 # define _pgmptr _pgmptr_dll
270 # endif /* __DECLSPEC_SUPPORTED */
271 /* no wide version in CRTDLL */
272 #endif /* __MSVCRT__ */
275 * This variable determines the default file mode.
276 * TODO: Which flags work?
278 #if !defined (__DECLSPEC_SUPPORTED) || defined (__IN_MINGW_RUNTIME)
281 extern int* _imp___fmode;
282 #define _fmode (*_imp___fmode)
285 extern int* _imp___fmode_dll;
286 #define _fmode (*_imp___fmode_dll)
289 #else /* __DECLSPEC_SUPPORTED */
292 __MINGW_IMPORT int _fmode;
293 #else /* ! __MSVCRT__ */
294 __MINGW_IMPORT int _fmode_dll;
295 #define _fmode _fmode_dll
296 #endif /* ! __MSVCRT__ */
298 #endif /* __DECLSPEC_SUPPORTED */
300 #endif /* Not __STRICT_ANSI__ */
302 _CRTIMP double __cdecl __MINGW_NOTHROW atof (const char*);
303 _CRTIMP int __cdecl __MINGW_NOTHROW atoi (const char*);
304 _CRTIMP long __cdecl __MINGW_NOTHROW atol (const char*);
305 #if !defined (__STRICT_ANSI__)
306 _CRTIMP double __cdecl __MINGW_NOTHROW _wtof (const wchar_t *);
307 _CRTIMP int __cdecl __MINGW_NOTHROW _wtoi (const wchar_t *);
308 _CRTIMP long __cdecl __MINGW_NOTHROW _wtol (const wchar_t *);
310 #if !defined __NO_ISOCEXT /* in libmingwex.a */
311 double __cdecl __MINGW_NOTHROW __strtod (const char*, char**);
312 extern double __cdecl __MINGW_NOTHROW
313 strtod (const char* __restrict__ __nptr, char** __restrict__ __endptr);
314 float __cdecl __MINGW_NOTHROW strtof (const char * __restrict__, char ** __restrict__);
315 long double __cdecl __MINGW_NOTHROW strtold (const char * __restrict__, char ** __restrict__);
317 _CRTIMP double __cdecl __MINGW_NOTHROW strtod (const char*, char**);
318 #endif /* __NO_ISOCEXT */
320 _CRTIMP long __cdecl __MINGW_NOTHROW strtol (const char*, char**, int);
321 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW strtoul (const char*, char**, int);
323 #ifndef _WSTDLIB_DEFINED
324 /* also declared in wchar.h */
325 _CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t*, wchar_t**, int);
326 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int);
327 _CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**);
328 #if !defined __NO_ISOCEXT /* in libmingwex.a */
329 float __cdecl __MINGW_NOTHROW wcstof( const wchar_t * __restrict__, wchar_t ** __restrict__);
330 long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
331 #endif /* __NO_ISOCEXT */
333 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*);
334 _CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*);
335 _CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
336 _CRTIMP int __cdecl __MINGW_NOTHROW _wsystem(const wchar_t*);
337 _CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
338 _CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
339 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t);
341 #define _WSTDLIB_DEFINED
344 _CRTIMP size_t __cdecl __MINGW_NOTHROW wcstombs (char*, const wchar_t*, size_t);
345 _CRTIMP int __cdecl __MINGW_NOTHROW wctomb (char*, wchar_t);
347 _CRTIMP int __cdecl __MINGW_NOTHROW mblen (const char*, size_t);
348 _CRTIMP size_t __cdecl __MINGW_NOTHROW mbstowcs (wchar_t*, const char*, size_t);
349 _CRTIMP int __cdecl __MINGW_NOTHROW mbtowc (wchar_t*, const char*, size_t);
351 _CRTIMP int __cdecl __MINGW_NOTHROW rand (void);
352 _CRTIMP void __cdecl __MINGW_NOTHROW srand (unsigned int);
354 _CRTIMP void* __cdecl __MINGW_NOTHROW calloc (size_t, size_t) __MINGW_ATTRIB_MALLOC;
355 _CRTIMP void* __cdecl __MINGW_NOTHROW malloc (size_t) __MINGW_ATTRIB_MALLOC;
356 _CRTIMP void* __cdecl __MINGW_NOTHROW realloc (void*, size_t);
357 _CRTIMP void __cdecl __MINGW_NOTHROW free (void*);
358 _CRTIMP void __cdecl __MINGW_NOTHROW abort (void) __MINGW_ATTRIB_NORETURN;
359 _CRTIMP void __cdecl __MINGW_NOTHROW exit (int) __MINGW_ATTRIB_NORETURN;
361 /* Note: This is in startup code, not imported directly from dll */
362 int __cdecl __MINGW_NOTHROW atexit (void (*)(void));
364 _CRTIMP int __cdecl __MINGW_NOTHROW system (const char*);
365 _CRTIMP char* __cdecl __MINGW_NOTHROW getenv (const char*);
367 /* bsearch and qsort are also in non-ANSI header search.h */
368 _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t,
369 int (*)(const void*, const void*));
370 _CRTIMP void __cdecl qsort(void*, size_t, size_t,
371 int (*)(const void*, const void*));
373 _CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST;
374 _CRTIMP long __cdecl __MINGW_NOTHROW labs (long) __MINGW_ATTRIB_CONST;
377 * div_t and ldiv_t are structures used to return the results of div and
380 * NOTE: div and ldiv appear not to work correctly unless
381 * -fno-pcc-struct-return is specified. This is included in the
382 * mingw32 specs file.
384 typedef struct { int quot, rem; } div_t;
385 typedef struct { long quot, rem; } ldiv_t;
387 _CRTIMP div_t __cdecl __MINGW_NOTHROW div (int, int) __MINGW_ATTRIB_CONST;
388 _CRTIMP ldiv_t __cdecl __MINGW_NOTHROW ldiv (long, long) __MINGW_ATTRIB_CONST;
390 #if !defined (__STRICT_ANSI__)
393 * NOTE: Officially the three following functions are obsolete. The Win32 API
394 * functions SetErrorMode, Beep and Sleep are their replacements.
396 _CRTIMP void __cdecl __MINGW_NOTHROW _beep (unsigned int, unsigned int) __MINGW_ATTRIB_DEPRECATED;
397 /* Not to be confused with _set_error_mode (int). */
398 _CRTIMP void __cdecl __MINGW_NOTHROW _seterrormode (int) __MINGW_ATTRIB_DEPRECATED;
399 _CRTIMP void __cdecl __MINGW_NOTHROW _sleep (unsigned long) __MINGW_ATTRIB_DEPRECATED;
401 _CRTIMP void __cdecl __MINGW_NOTHROW _exit (int) __MINGW_ATTRIB_NORETURN;
403 /* _onexit is MS extension. Use atexit for portability. */
404 /* Note: This is in startup code, not imported directly from dll */
405 typedef int (* _onexit_t)(void);
406 _onexit_t __cdecl __MINGW_NOTHROW _onexit( _onexit_t );
408 _CRTIMP int __cdecl __MINGW_NOTHROW _putenv (const char*);
409 _CRTIMP void __cdecl __MINGW_NOTHROW _searchenv (const char*, const char*, char*);
411 _CRTIMP char* __cdecl __MINGW_NOTHROW _ecvt (double, int, int*, int*);
412 _CRTIMP char* __cdecl __MINGW_NOTHROW _fcvt (double, int, int*, int*);
413 _CRTIMP char* __cdecl __MINGW_NOTHROW _gcvt (double, int, char*);
415 _CRTIMP void __cdecl __MINGW_NOTHROW _makepath (char*, const char*, const char*, const char*, const char*);
416 _CRTIMP void __cdecl __MINGW_NOTHROW _splitpath (const char*, char*, char*, char*, char*);
417 _CRTIMP char* __cdecl __MINGW_NOTHROW _fullpath (char*, const char*, size_t);
419 _CRTIMP char* __cdecl __MINGW_NOTHROW _itoa (int, char*, int);
420 _CRTIMP char* __cdecl __MINGW_NOTHROW _ltoa (long, char*, int);
421 _CRTIMP char* __cdecl __MINGW_NOTHROW _ultoa(unsigned long, char*, int);
422 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _itow (int, wchar_t*, int);
423 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ltow (long, wchar_t*, int);
424 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ultow (unsigned long, wchar_t*, int);
427 _CRTIMP __int64 __cdecl __MINGW_NOTHROW _atoi64(const char *);
428 _CRTIMP char* __cdecl __MINGW_NOTHROW _i64toa(__int64, char *, int);
429 _CRTIMP char* __cdecl __MINGW_NOTHROW _ui64toa(unsigned __int64, char *, int);
430 _CRTIMP __int64 __cdecl __MINGW_NOTHROW _wtoi64(const wchar_t *);
431 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _i64tow(__int64, wchar_t *, int);
432 _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ui64tow(unsigned __int64, wchar_t *, int);
434 _CRTIMP unsigned int __cdecl __MINGW_NOTHROW (_rotl)(unsigned int, int) __MINGW_ATTRIB_CONST;
435 _CRTIMP unsigned int __cdecl __MINGW_NOTHROW (_rotr)(unsigned int, int) __MINGW_ATTRIB_CONST;
436 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW (_lrotl)(unsigned long, int) __MINGW_ATTRIB_CONST;
437 _CRTIMP unsigned long __cdecl __MINGW_NOTHROW (_lrotr)(unsigned long, int) __MINGW_ATTRIB_CONST;
439 _CRTIMP int __cdecl __MINGW_NOTHROW _set_error_mode (int);
441 # define _OUT_TO_DEFAULT 0
442 # define _OUT_TO_STDERR 1
443 # define _OUT_TO_MSGBOX 2
444 # define _REPORT_ERRMODE 3
446 # if __MSVCRT_VERSION__ >= 0x800
447 # ifndef _UINTPTR_T_DEFINED
448 # define _UINTPTR_T_DEFINED
450 typedef unsigned __int64 uintptr_t;
452 typedef unsigned int uintptr_t;
456 _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_abort_behavior (unsigned int, unsigned int);
458 /* These masks work with msvcr80.dll version 8.0.50215.44 (a beta release). */
459 # define _WRITE_ABORT_MSG 1
460 # define _CALL_REPORTFAULT 2
463 (* _invalid_parameter_handler) (
469 _invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler);
471 # endif /* __MSVCRT_VERSION__ >= 0x800 */
472 #endif /* __MSVCRT__ */
476 _CRTIMP int __cdecl __MINGW_NOTHROW putenv (const char*);
477 _CRTIMP void __cdecl __MINGW_NOTHROW searchenv (const char*, const char*, char*);
479 _CRTIMP char* __cdecl __MINGW_NOTHROW itoa (int, char*, int);
480 _CRTIMP char* __cdecl __MINGW_NOTHROW ltoa (long, char*, int);
483 _CRTIMP char* __cdecl __MINGW_NOTHROW ecvt (double, int, int*, int*);
484 _CRTIMP char* __cdecl __MINGW_NOTHROW fcvt (double, int, int*, int*);
485 _CRTIMP char* __cdecl __MINGW_NOTHROW gcvt (double, int, char*);
487 #endif /* Not _NO_OLDNAMES */
489 #endif /* Not __STRICT_ANSI__ */
493 #if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
495 /* C99 name for _exit */
496 void __cdecl __MINGW_NOTHROW _Exit(int) __MINGW_ATTRIB_NORETURN;
497 #if !defined __NO_INLINE__ && !defined __STRICT_ANSI__
498 __CRT_INLINE __JMPSTUB__(( FUNCTION = _Exit, REMAPPED = _exit ))
499 void __cdecl __MINGW_NOTHROW _Exit( int __status ){ _exit (__status); }
502 typedef struct { long long quot, rem; } lldiv_t;
504 lldiv_t __cdecl __MINGW_NOTHROW lldiv (long long, long long) __MINGW_ATTRIB_CONST;
506 long long __cdecl __MINGW_NOTHROW llabs(long long);
507 #ifndef __NO_INLINE__
509 /* No JMPSTUB or LIBIMPL reference here -- we provide a free-standing
510 * implementation, along with imaxabs(), in mingwex/imaxabs.c
512 long long __cdecl __MINGW_NOTHROW llabs( long long __j )
513 { return __j >= 0 ? __j : -__j; }
516 long long __cdecl __MINGW_NOTHROW strtoll (const char* __restrict__, char** __restrict, int);
517 unsigned long long __cdecl __MINGW_NOTHROW strtoull (const char* __restrict__, char** __restrict__, int);
519 #if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
520 long long __cdecl __MINGW_NOTHROW atoll (const char *);
522 #if !defined (__STRICT_ANSI__)
523 long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t *);
524 char* __cdecl __MINGW_NOTHROW lltoa (long long, char *, int);
525 char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long , char *, int);
526 wchar_t* __cdecl __MINGW_NOTHROW lltow (long long, wchar_t *, int);
527 wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long, wchar_t *, int);
529 #ifndef __NO_INLINE__ /* inline support for non-ansi functions */
531 __CRT_INLINE __JMPSTUB__(( FUNCTION = atoll, REMAPPED = _atoi64 ))
532 long long __cdecl __MINGW_NOTHROW atoll (const char * _c){ return _atoi64 (_c); }
534 __CRT_INLINE __JMPSTUB__(( FUNCTION = lltoa, REMAPPED = _i64toa ))
535 char* __cdecl __MINGW_NOTHROW lltoa (long long _n, char * _c, int _i)
536 { return _i64toa (_n, _c, _i); }
538 __CRT_INLINE __JMPSTUB__(( FUNCTION = ulltoa, REMAPPED = _ui64toa ))
539 char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long _n, char * _c, int _i)
540 { return _ui64toa (_n, _c, _i); }
542 __CRT_INLINE __JMPSTUB__(( FUNCTION = wtoll, REMAPPED = _wtoi64 ))
543 long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t * _w){ return _wtoi64 (_w); }
545 __CRT_INLINE __JMPSTUB__(( FUNCTION = lltow, REMAPPED = _i64tow ))
546 wchar_t* __cdecl __MINGW_NOTHROW lltow (long long _n, wchar_t * _w, int _i)
547 { return _i64tow (_n, _w, _i); }
549 __CRT_INLINE __JMPSTUB__(( FUNCTION = ulltow, REMAPPED = _ui64tow ))
550 wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, int _i)
551 { return _ui64tow (_n, _w, _i); }
553 #endif /* (__NO_INLINE__) */
554 #endif /* (__STRICT_ANSI__) */
556 #endif /* __MSVCRT__ */
557 #endif /* !__NO_ISOCEXT */
559 /* POSIX/BSD extensions in libmingwex.a; these should be exposed only on
560 * the basis of appropriate POSIX or BSD specific feature tests...
562 * mkstemp(3) function support; added per feature request #2003.
563 * POSIX wants _XOPEN_SOURCE >= 500, (implying _POSIX_C_SOURCE >= 200112L).
565 #if _POSIX_C_SOURCE >= 200112L
567 int __cdecl __MINGW_NOTHROW mkstemp( char * );
568 int __cdecl __MINGW_NOTHROW __mingw_mkstemp( int, char * );
570 /* The following macros are a MinGW specific extension, to facilite
571 * use of _O_TEMPORARY, (in addition to the POSIX required attributes),
572 * when creating the temporary file. Note that they require fcntl.h,
573 * which stdlib.h should NOT automatically include; we leave the onus
574 * on the user to explicitly include it, if using MKSTEMP_SETMODE.
576 #define _MKSTEMP_INVOKE 0
577 #define _MKSTEMP_DEFAULT _O_CREAT | _O_EXCL | _O_RDWR
578 #define _MKSTEMP_SETMODE(M) __mingw_mkstemp( _MKSTEMP_DEFAULT | (M), NULL )
581 #define MKSTEMP_SETMODE(M) __mingw_mkstemp( _MKSTEMP_DEFAULT | (M), NULL )
584 __CRT_ALIAS __LIBIMPL__(( FUNCTION = mkstemp ))
585 int __cdecl __MINGW_NOTHROW mkstemp( char *__filename_template )
586 { return __mingw_mkstemp( _MKSTEMP_INVOKE, __filename_template ); }
588 #endif /* _POSIX_C_SOURCE >= 200112L (for mkstemp()) */
590 /* mkdtemp(3) function support: added as adjunct to feature request #2003.
591 * POSIX wants _XOPEN_SOURCE >= 700, (implying _POSIX_C_SOURCE >= 200809L).
593 #if _POSIX_C_SOURCE >= 200809L
595 char * __cdecl __MINGW_NOTHROW mkdtemp( char * );
596 char * __cdecl __MINGW_NOTHROW __mingw_mkdtemp( char * );
598 __CRT_ALIAS __JMPSTUB__(( FUNCTION = mkdtemp ))
599 char * __cdecl __MINGW_NOTHROW mkdtemp( char *__dirname_template )
600 { return __mingw_mkdtemp( __dirname_template ); }
602 #endif /* _POSIX_C_SOURCE >= 200809L (for mkdtemp()) */
606 #endif /* Not RC_INVOKED */
607 #endif /* Not _STDLIB_H_ */