mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Simplify gettimeofday() fallback logic.
There's no known supported system needing 1 argument gettimeofday()
support. The test for it was added a long time ago (92c6bf9775
). Remove.
Until now we tested whether a gettimeofday() fallback is needed when
targetting windows. Which lead to the odd result that HAVE_GETTIMEOFDAY only
being defined when targetting MinGW (which has gettimeofday() since at least
2007). As the fallback is specific to msvc, remove the configure code and
rename src/port/gettimeofday.c to src/port/win32gettimeofday.c.
While at it, also remove the definition of struct timezone, a forward
declaration of the struct is sufficient.
Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-By: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/20220806000311.ywx65iuchvj4qn2k@awork3.anarazel.de
This commit is contained in:
47
configure
vendored
47
configure
vendored
@ -15945,39 +15945,6 @@ if test x"$pgac_cv_var_int_timezone" = xyes ; then
|
||||
$as_echo "#define HAVE_INT_TIMEZONE 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday takes only one argument" >&5
|
||||
$as_echo_n "checking whether gettimeofday takes only one argument... " >&6; }
|
||||
if ${pgac_cv_func_gettimeofday_1arg+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <sys/time.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct timeval *tp;
|
||||
struct timezone *tzp;
|
||||
gettimeofday(tp,tzp);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
pgac_cv_func_gettimeofday_1arg=no
|
||||
else
|
||||
pgac_cv_func_gettimeofday_1arg=yes
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_gettimeofday_1arg" >&5
|
||||
$as_echo "$pgac_cv_func_gettimeofday_1arg" >&6; }
|
||||
if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
|
||||
|
||||
$as_echo "#define GETTIMEOFDAY_1ARG 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wcstombs_l declaration" >&5
|
||||
$as_echo_n "checking for wcstombs_l declaration... " >&6; }
|
||||
if ${pgac_cv_func_wcstombs_l+:} false; then :
|
||||
@ -16909,20 +16876,6 @@ _ACEOF
|
||||
fi
|
||||
done
|
||||
|
||||
ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
|
||||
if test "x$ac_cv_func_gettimeofday" = xyes; then :
|
||||
$as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
|
||||
|
||||
else
|
||||
case " $LIBOBJS " in
|
||||
*" gettimeofday.$ac_objext "* ) ;;
|
||||
*) LIBOBJS="$LIBOBJS gettimeofday.$ac_objext"
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
|
||||
case " $LIBOBJS " in
|
||||
*" dirmod.$ac_objext "* ) ;;
|
||||
*) LIBOBJS="$LIBOBJS dirmod.$ac_objext"
|
||||
|
Reference in New Issue
Block a user