1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-24 01:29:19 +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:
Andres Freund
2022-08-06 08:34:56 -07:00
parent 6c1c9f88ad
commit 922a8fa098
9 changed files with 9 additions and 103 deletions

View File

@@ -179,16 +179,11 @@
#define SIGUSR1 30
#define SIGUSR2 31
/*
* New versions of MinGW have gettimeofday() and also declare
* struct timezone to support it.
*/
#ifndef HAVE_GETTIMEOFDAY
struct timezone
{
int tz_minuteswest; /* Minutes west of GMT. */
int tz_dsttime; /* Nonzero if DST is ever in effect. */
};
/* MinW has gettimeofday(), but MSVC doesn't */
#ifdef _MSC_VER
struct timezone;
/* Last parameter not used */
extern int gettimeofday(struct timeval *tp, struct timezone *tzp);
#endif
/* for setitimer in backend/port/win32/timer.c */