system_error: correct ELAST emulation on Windows

ELAST should point to the last valid error string value.  However,
`_sys_nerr` provides the number of elements in the errlist array.  Since
the index is 0-based, this is off-by-one.  Adjust it accordingly.

Thanks to David Majnemer for catching this!

llvm-svn: 291336
This commit is contained in:
Saleem Abdulrasool 2017-01-07 05:13:32 +00:00
parent ee5cb65ada
commit 49a10e1c07
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@
#elif defined(__sun__)
#define _LIBCPP_ELAST ESTALE
#elif defined(_LIBCPP_MSVCRT)
#define _LIBCPP_ELAST _sys_nerr
#define _LIBCPP_ELAST (_sys_nerr - 1)
#else
// Warn here so that the person doing the libcxx port has an easier time:
#warning ELAST for this platform not yet implemented