summaryrefslogtreecommitdiffstats
path: root/libcxx/src
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-01-07 05:13:32 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-01-07 05:13:32 +0000
commit49a10e1c07bdda958fee7ddc9333e50cb8d08507 (patch)
tree5d3ce965d5184a89e50aebf71fab0dec725b255f /libcxx/src
parentee5cb65ada184a3426bae07834066464978eab33 (diff)
downloadbcm5719-llvm-49a10e1c07bdda958fee7ddc9333e50cb8d08507.tar.gz
bcm5719-llvm-49a10e1c07bdda958fee7ddc9333e50cb8d08507.zip
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
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/include/config_elast.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/src/include/config_elast.h b/libcxx/src/include/config_elast.h
index 97104290d88..8328978ef95 100644
--- a/libcxx/src/include/config_elast.h
+++ b/libcxx/src/include/config_elast.h
@@ -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
OpenPOWER on IntegriCloud