The MinGW.org Windows System Libraries
Revisão | 1d9d68e1214ff0588f91aba60b82d3b612044bdc (tree) |
---|---|
Hora | 2016-09-15 05:26:25 |
Autor | Keith Marshall <keithmarshall@user...> |
Commiter | Keith Marshall |
Relax strict ISO-C conformity to facilitate C99 support.
@@ -1,3 +1,13 @@ | ||
1 | +2016-09-14 Keith Marshall <keithmarshall@users.sourceforge.net> | |
2 | + | |
3 | + Relax strict ISO-C conformity to facilitate C99 support. | |
4 | + | |
5 | + * include/stdlib.h (_atoi64, _exit) [__STRICT_ANSI__]: Convention | |
6 | + dictates that the Microsoft specific functions should not be declared; | |
7 | + however, C99 provides equivalents in atoll() and _Exit(), for which we | |
8 | + gratuituously use them to provide inline implementations; thus... | |
9 | + [_ISOC99_SOURCE && !__NO_INLINE__]: ...declare them anyway. | |
10 | + | |
1 | 11 | 2016-09-13 Keith Marshall <keithmarshall@users.sourceforge.net> |
2 | 12 | |
3 | 13 | Suppress expected header warnings when running testsuite. |
@@ -522,6 +522,22 @@ typedef struct { long quot, rem; } ldiv_t; | ||
522 | 522 | _CRTIMP __cdecl __MINGW_NOTHROW div_t div (int, int) __MINGW_ATTRIB_CONST; |
523 | 523 | _CRTIMP __cdecl __MINGW_NOTHROW ldiv_t ldiv (long, long) __MINGW_ATTRIB_CONST; |
524 | 524 | |
525 | +#if !defined __STRICT_ANSI__ || (defined _ISOC99_SOURCE && !defined __NO_INLINE__) | |
526 | +/* Although not nominally valid in "__STRICT_ANSI__" mode, when compiling C99 | |
527 | + * source, we use Microsoft's _exit() function to facilitate our provision of | |
528 | + * an inline implementation of ISO-C99's _Exit() function. | |
529 | + */ | |
530 | +_CRTIMP __cdecl __MINGW_NOTHROW void _exit (int) __MINGW_ATTRIB_NORETURN; | |
531 | + | |
532 | +#ifdef __MSVCRT__ | |
533 | +/* Similarly, we use Microsoft's MSVCRT.DLL specific _atoi64() function, | |
534 | + * to facilitate an inline implementation of ISO-C99's atoll() function. | |
535 | + */ | |
536 | +_CRTIMP __cdecl __MINGW_NOTHROW __int64 _atoi64 (const char *); | |
537 | + | |
538 | +#endif /* __MSVCRT__ */ | |
539 | +#endif /* !__STRICT_ANSI__ || (_ISOC99_SOURCE && !__NO_INLINE__) */ | |
540 | + | |
525 | 541 | #if !defined (__STRICT_ANSI__) |
526 | 542 | /* NOTE: Officially the three following functions are obsolete. The Win32 API |
527 | 543 | * functions SetErrorMode, Beep and Sleep are their replacements. |
@@ -531,8 +547,6 @@ _CRTIMP __cdecl __MINGW_NOTHROW void _beep (unsigned int, unsigned int) __MINGW | ||
531 | 547 | _CRTIMP __cdecl __MINGW_NOTHROW void _seterrormode (int) __MINGW_ATTRIB_DEPRECATED; |
532 | 548 | _CRTIMP __cdecl __MINGW_NOTHROW void _sleep (unsigned long) __MINGW_ATTRIB_DEPRECATED; |
533 | 549 | |
534 | -_CRTIMP __cdecl __MINGW_NOTHROW void _exit (int) __MINGW_ATTRIB_NORETURN; | |
535 | - | |
536 | 550 | /* _onexit is a Microsoft extension. Use atexit for portability. */ |
537 | 551 | /* Note: This is in startup code, not imported directly from dll */ |
538 | 552 | typedef int (* _onexit_t)(void); |
@@ -562,7 +576,6 @@ _CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_ltow (long, wchar_t *, int); | ||
562 | 576 | _CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_ultow (unsigned long, wchar_t *, int); |
563 | 577 | |
564 | 578 | #ifdef __MSVCRT__ |
565 | -_CRTIMP __cdecl __MINGW_NOTHROW __int64 _atoi64 (const char *); | |
566 | 579 | _CRTIMP __cdecl __MINGW_NOTHROW char* _i64toa (__int64, char *, int); |
567 | 580 | _CRTIMP __cdecl __MINGW_NOTHROW char* _ui64toa (unsigned __int64, char *, int); |
568 | 581 | _CRTIMP __cdecl __MINGW_NOTHROW __int64 _wtoi64 (const wchar_t *); |