diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-09-19 19:39:34 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-09-19 19:39:34 +0000 |
| commit | 2ee8a62f0f8d727f7d0a03717d09f9c82199ee2a (patch) | |
| tree | 3bafd19cbbe70e6c16eb4c6adb33f27c4169febd | |
| parent | 0f80acb9659de250230e9027c40ae7d937f24dad (diff) | |
Notes
| -rw-r--r-- | contrib/libc++/include/__config | 7 | ||||
| -rw-r--r-- | contrib/libc++/include/cstdio | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/contrib/libc++/include/__config b/contrib/libc++/include/__config index 1ecced9f4792..85c2ba962fdd 100644 --- a/contrib/libc++/include/__config +++ b/contrib/libc++/include/__config @@ -1129,6 +1129,13 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( #define _LIBCPP_HAS_NO_STDOUT #endif +// Some systems do not provide gets() in their C library, for security reasons. +#ifndef _LIBCPP_C_HAS_NO_GETS +# if defined(_LIBCPP_MSVCRT) || (defined(__FreeBSD__) && __FreeBSD__ >= 13) +# define _LIBCPP_C_HAS_NO_GETS +# endif +#endif + #if defined(__BIONIC__) || defined(__CloudABI__) || \ defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE diff --git a/contrib/libc++/include/cstdio b/contrib/libc++/include/cstdio index ebb29bee7c99..0f3f42dac2da 100644 --- a/contrib/libc++/include/cstdio +++ b/contrib/libc++/include/cstdio @@ -73,6 +73,7 @@ int fputc(int c, FILE* stream); int fputs(const char* restrict s, FILE* restrict stream); int getc(FILE* stream); int getchar(void); +char* gets(char* s); // removed in C++14 int putc(int c, FILE* stream); int putchar(int c); int puts(const char* s); @@ -151,6 +152,9 @@ using ::tmpnam; #ifndef _LIBCPP_HAS_NO_STDIN using ::getchar; +#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS) +using ::gets; +#endif using ::scanf; using ::vscanf; #endif |
