summaryrefslogtreecommitdiff
path: root/libcxx
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-09-01 21:09:19 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-09-01 21:09:19 +0000
commit6e423c0eddd60caa01beaf3731b0480160f186eb (patch)
tree2191799191417cedc2da21e161e3e1b4b56b4745 /libcxx
parentbefdae6ccf015176fe56939cfbce71d78d9f20b7 (diff)
cstdio: limit gets to CRT versions below 14
Microsoft removed gets from the CRT in Visual Studio 2015 onwards [1]. Attempting to reference it when targeting CRT versions 14 and above will cause compile errors. [1] https://msdn.microsoft.com/en-us/library/2029ea5f.aspx Patch by Shoaib Meenai!
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/cstdio6
1 files changed, 5 insertions, 1 deletions
diff --git a/libcxx/include/cstdio b/libcxx/include/cstdio
index 50fdd345742..801348837c4 100644
--- a/libcxx/include/cstdio
+++ b/libcxx/include/cstdio
@@ -98,6 +98,9 @@ void perror(const char* s);
#include <__config>
#include <stdio.h>
+#if defined(_LIBCPP_MSVCRT)
+#include <crtversion.h>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -155,7 +158,8 @@ using ::tmpnam;
#ifndef _LIBCPP_HAS_NO_STDIN
using ::getchar;
-#if _LIBCPP_STD_VER <= 11
+#if _LIBCPP_STD_VER <= 11 && \
+ (!defined(_VC_CRT_MAJOR_VERSION) || _VC_CRT_MAJOR_VERSION < 14)
using ::gets;
#endif
using ::scanf;