diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-09-01 21:09:19 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-09-01 21:09:19 +0000 |
commit | e68b47070f617ffa8becd3c9d777a93cf2c3b6a8 (patch) | |
tree | 8be03b9a0942737f8fbf7ab96aed4a2a62f2ee1f | |
parent | 90646fe815d254fd50144ba72c56247785048b64 (diff) | |
download | bcm5719-llvm-e68b47070f617ffa8becd3c9d777a93cf2c3b6a8.tar.gz bcm5719-llvm-e68b47070f617ffa8becd3c9d777a93cf2c3b6a8.zip |
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!
llvm-svn: 280417
-rw-r--r-- | libcxx/include/cstdio | 6 |
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; |