[Mingw-w64-public] [PATCH] crt: Fix setting errno in the strtod based strtof implementation
In this case, strtod will have set errno for cases that were out of range for doubles. For doubles that were in range, but that are out of ranges for float, set errno before returning. Signed-off-by: Martin Storsjö --- mingw-w64-crt/stdio/strtof.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mingw-w64-crt/stdio/strtof.c b/mingw-w64-crt/stdio/strtof.c index 5697eb4b5..c4e4eb918 100644 --- a/mingw-w64-crt/stdio/strtof.c +++ b/mingw-w64-crt/stdio/strtof.c @@ -4,8 +4,24 @@ * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ #include +#include +#include +#include float strtof( const char *nptr, char **endptr) { - return (strtod(nptr, endptr)); + double ret = strtod(nptr, endptr); + if (isfinite(ret)) { +/* Check for cases that aren't out of range for doubles, but that are + * for floats. */ +if (ret > FLT_MAX) + errno = ERANGE; +else if (ret < -FLT_MAX) + errno = ERANGE; +else if (ret > 0 && ret < FLT_MIN) + errno = ERANGE; +else if (ret < 0 && ret > -FLT_MIN) + errno = ERANGE; + } + return ret; } -- 2.25.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH] Add missing members into MINIDUMP_TYPE
Signed-off-by: Ruslan Garipov --- mingw-w64-headers/include/psdk_inc/_dbg_common.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mingw-w64-headers/include/psdk_inc/_dbg_common.h b/mingw-w64-headers/include/psdk_inc/_dbg_common.h index 48f2b9d7d..4018bad8c 100644 --- a/mingw-w64-headers/include/psdk_inc/_dbg_common.h +++ b/mingw-w64-headers/include/psdk_inc/_dbg_common.h @@ -1531,7 +1531,13 @@ typedef struct _MINIDUMP_MEMORY_INFO_LIST { MiniDumpWithFullAuxiliaryState = 0x8000, MiniDumpWithPrivateWriteCopyMemory = 0x0001, MiniDumpIgnoreInaccessibleMemory = 0x0002, -MiniDumpWithTokenInformation = 0x0004 +MiniDumpWithTokenInformation = 0x0004, +MiniDumpWithModuleHeaders= 0x0008, +MiniDumpFilterTriage = 0x0010, +MiniDumpWithAvxXStateContext = 0x0020, +MiniDumpWithIptTrace = 0x0040, +MiniDumpScanInaccessiblePartialPages = 0x0080, +MiniDumpValidTypeFlags = 0x00ff, } MINIDUMP_TYPE; #define MINIDUMP_THREAD_INFO_ERROR_THREAD0x0001 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCHv2] headers/wincon: Don't define `LF_FACESIZE` when `NOGDI` is in, effect
On 5/29/21 3:20 PM, Liu Hao wrote: 在 2021-05-26 09:56, Liu Hao 写道: When `NOGDI` is not defined (i.e. when GDI is desired), `LF_FACESIZE` is always defined, so there is no need to check for it here. ping? Looks good to me, thanks for looking into this. OpenPGP_signature Description: OpenPGP digital signature ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCHv2] headers/wincon: Don't define `LF_FACESIZE` when `NOGDI` is in, effect
在 2021-05-26 09:56, Liu Hao 写道: When `NOGDI` is not defined (i.e. when GDI is desired), `LF_FACESIZE` is always defined, so there is no need to check for it here. ping? -- Best regards, Liu Hao OpenPGP_signature Description: OpenPGP digital signature ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public