These shall work in compliance with [1] and [2]. [1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/get-errno?view=msvc-170 [2] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-errno?view=msvc-170
Signed-off-by: LIU Hao <[email protected]> --- mingw-w64-crt/misc/seterrno.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mingw-w64-crt/misc/seterrno.c b/mingw-w64-crt/misc/seterrno.c index 952675da..ab54c668 100644 --- a/mingw-w64-crt/misc/seterrno.c +++ b/mingw-w64-crt/misc/seterrno.c @@ -8,11 +8,17 @@ errno_t __cdecl _set_errno (int _Value) { errno = _Value; - return errno; + return 0; } errno_t __cdecl _get_errno (int *_Value) { - if(_Value) *_Value=errno; - return errno; + if(!_Value) + { + errno = EINVAL; + return EINVAL; + } + + *_Value = errno; + return 0; } -- 2.34.1
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
