bpo-41340: Removed fallback implementation for strdup (GH-21634)

This commit is contained in:
wasiher 2020-07-27 12:28:45 +09:00 committed by GitHub
parent f1d40f941a
commit 5798f78777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 29 deletions

View File

@ -0,0 +1 @@
Removed fallback implementation for ``strdup``.

View File

@ -1,12 +0,0 @@
/* strdup() replacement (from stdwin, if you must know) */
char *
strdup(const char *str)
{
if (str != NULL) {
char *copy = malloc(strlen(str) + 1);
if (copy != NULL)
return strcpy(copy, str);
}
return NULL;
}

13
configure vendored
View File

@ -12829,19 +12829,6 @@ esac
fi fi
ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
if test "x$ac_cv_func_strdup" = xyes; then :
$as_echo "#define HAVE_STRDUP 1" >>confdefs.h
else
case " $LIBOBJS " in
*" strdup.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS strdup.$ac_objext"
;;
esac
fi
for ac_func in getpgrp for ac_func in getpgrp
do : do :

View File

@ -3970,7 +3970,7 @@ AC_CHECK_FUNCS(forkpty,,
# check for long file support functions # check for long file support functions
AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs) AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)
AC_REPLACE_FUNCS(dup2 strdup) AC_REPLACE_FUNCS(dup2)
AC_CHECK_FUNCS(getpgrp, AC_CHECK_FUNCS(getpgrp,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[getpgrp(0);]])], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[getpgrp(0);]])],
[AC_DEFINE(GETPGRP_HAVE_ARG, 1, [Define if getpgrp() must be called as getpgrp(0).])], [AC_DEFINE(GETPGRP_HAVE_ARG, 1, [Define if getpgrp() must be called as getpgrp(0).])],

View File

@ -1034,9 +1034,6 @@
/* Has stdatomic.h with atomic_int and atomic_uintptr_t */ /* Has stdatomic.h with atomic_int and atomic_uintptr_t */
#undef HAVE_STD_ATOMIC #undef HAVE_STD_ATOMIC
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strftime' function. */ /* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME #undef HAVE_STRFTIME