[libcxx-commits] [libcxx] 761b9d9 - [libc++] Remove _LIBCPP_C_HAS_NO_GETS (#77346)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 10 10:34:07 PST 2024


Author: Louis Dionne
Date: 2024-01-10T13:34:03-05:00
New Revision: 761b9d9e4631aa85f932e5ee33aae1f7b8a0538e

URL: https://github.com/llvm/llvm-project/commit/761b9d9e4631aa85f932e5ee33aae1f7b8a0538e
DIFF: https://github.com/llvm/llvm-project/commit/761b9d9e4631aa85f932e5ee33aae1f7b8a0538e.diff

LOG: [libc++] Remove _LIBCPP_C_HAS_NO_GETS (#77346)

Since we use _LIBCPP_USING_IF_EXISTS to handle missing C library functions
now, _LIBCPP_C_HAS_NO_GETS shouldn't be necessary anymore.
See the discussion thread in #77242 for more details.

Added: 
    

Modified: 
    libcxx/include/__config
    libcxx/include/cstdio

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__config b/libcxx/include/__config
index 082c73e672c749..1958d5c50ca911 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1133,11 +1133,6 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
 #    define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
 #  endif
 
-// Some systems do not provide gets() in their C library, for security reasons.
-#  if defined(_LIBCPP_MSVCRT) || (defined(__FreeBSD_version) && __FreeBSD_version >= 1300043) || defined(__OpenBSD__)
-#    define _LIBCPP_C_HAS_NO_GETS
-#  endif
-
 #  if defined(__BIONIC__) || defined(__NuttX__) || defined(__Fuchsia__) || defined(__wasi__) ||                        \
       defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__)
 #    define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE

diff  --git a/libcxx/include/cstdio b/libcxx/include/cstdio
index b1b0ff8d350393..0a867cec1a388b 100644
--- a/libcxx/include/cstdio
+++ b/libcxx/include/cstdio
@@ -159,7 +159,7 @@ using ::tmpfile _LIBCPP_USING_IF_EXISTS;
 using ::tmpnam _LIBCPP_USING_IF_EXISTS;
 
 using ::getchar _LIBCPP_USING_IF_EXISTS;
-#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS)
+#if _LIBCPP_STD_VER <= 11
 using ::gets _LIBCPP_USING_IF_EXISTS;
 #endif
 using ::scanf _LIBCPP_USING_IF_EXISTS;


        


More information about the libcxx-commits mailing list