From 0bdd81f23fcecd9f91b5ffb808bd7b75ee3ea3b1 Mon Sep 17 00:00:00 2001 From: keithmarshall Date: Thu, 25 Sep 2008 21:53:17 +0000 Subject: [PATCH] Fix MinGW-Bug [2125708]. --- winsup/mingw/ChangeLog | 10 ++++++++ winsup/mingw/include/stdlib.h | 54 +++++++++++++++++++++++-------------------- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index f8f668c222..fa8376e8ed 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,13 @@ +2008-09-25 Keith Marshall + + Fix MinGW-Bug [2125708]. + (Reported by Alexandr Zamaraev). + + * include/stdlib.h (intptr_t) [!_INTPTR_T_DEFINED]: Unused typedef; + not wanted here; remove it; replace it by... + (uintptr_t) [!_UINTPTR_T_DEFINED]: ...this typedef; needed by... + (_invalid_parameter_handler): ...this function typedef. + 2008-09-23 Chris Sutcliffe * Makefile.in: Don't include host_os as part of snapshot filename. diff --git a/winsup/mingw/include/stdlib.h b/winsup/mingw/include/stdlib.h index 07f6de535a..7af2b83a92 100644 --- a/winsup/mingw/include/stdlib.h +++ b/winsup/mingw/include/stdlib.h @@ -413,7 +413,6 @@ _onexit_t __cdecl __MINGW_NOTHROW _onexit( _onexit_t ); _CRTIMP int __cdecl __MINGW_NOTHROW _putenv (const char*); _CRTIMP void __cdecl __MINGW_NOTHROW _searchenv (const char*, const char*, char*); - _CRTIMP char* __cdecl __MINGW_NOTHROW _ecvt (double, int, int*, int*); _CRTIMP char* __cdecl __MINGW_NOTHROW _fcvt (double, int, int*, int*); _CRTIMP char* __cdecl __MINGW_NOTHROW _gcvt (double, int, char*); @@ -437,39 +436,44 @@ _CRTIMP __int64 __cdecl __MINGW_NOTHROW _wtoi64(const wchar_t *); _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _i64tow(__int64, wchar_t *, int); _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ui64tow(unsigned __int64, wchar_t *, int); - _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _rotl(unsigned int, int) __MINGW_ATTRIB_CONST; _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _rotr(unsigned int, int) __MINGW_ATTRIB_CONST; _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotl(unsigned long, int) __MINGW_ATTRIB_CONST; _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotr(unsigned long, int) __MINGW_ATTRIB_CONST; _CRTIMP int __cdecl __MINGW_NOTHROW _set_error_mode (int); -#define _OUT_TO_DEFAULT 0 -#define _OUT_TO_STDERR 1 -#define _OUT_TO_MSGBOX 2 -#define _REPORT_ERRMODE 3 - -#if __MSVCRT_VERSION__ >= 0x800 -#ifndef _INTPTR_T_DEFINED -#define _INTPTR_T_DEFINED -#ifdef _WIN64 - typedef __int64 intptr_t; -#else - typedef int intptr_t; -#endif -#endif + +# define _OUT_TO_DEFAULT 0 +# define _OUT_TO_STDERR 1 +# define _OUT_TO_MSGBOX 2 +# define _REPORT_ERRMODE 3 + +# if __MSVCRT_VERSION__ >= 0x800 +# ifndef _UINTPTR_T_DEFINED +# define _UINTPTR_T_DEFINED +# ifdef _WIN64 + typedef unsigned __int64 uintptr_t; +# else + typedef unsigned int uintptr_t; +# endif +# endif + _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_abort_behavior (unsigned int, unsigned int); + /* These masks work with msvcr80.dll version 8.0.50215.44 (a beta release). */ -#define _WRITE_ABORT_MSG 1 -#define _CALL_REPORTFAULT 2 - -typedef void (* _invalid_parameter_handler) (const wchar_t *, - const wchar_t *, - const wchar_t *, - unsigned int, - uintptr_t); +# define _WRITE_ABORT_MSG 1 +# define _CALL_REPORTFAULT 2 + +typedef void +(* _invalid_parameter_handler) ( + const wchar_t *, + const wchar_t *, + const wchar_t *, + unsigned int, + uintptr_t); _invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler); -#endif /* __MSVCRT_VERSION__ >= 0x800 */ + +# endif /* __MSVCRT_VERSION__ >= 0x800 */ #endif /* __MSVCRT__ */ #ifndef _NO_OLDNAMES -- 2.11.0