1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-24 01:29:19 +03:00

Simplify gettimeofday for Windows.

Previously we bothered to forward-declare struct timezone, following man
pages on typical systems, but POSIX actually says the argument (which we
ignore anyway) is void *.  Drop a line.

While here, add an assertion that nobody actually uses the tzp argument.

Previously we did extra work to select between Windows APIs needed on
older releases, but now we can just use the higher resolution function
directly.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CA%2BhUKGKwRpvGfcfq2qNVAQS2Wg1B9eA9QRhAmVSyJt1zsCN2sQ%40mail.gmail.com
This commit is contained in:
Thomas Munro
2022-08-07 12:35:11 +12:00
parent 5c7121bcf8
commit 24c3ce8f1c
2 changed files with 14 additions and 58 deletions

View File

@@ -179,11 +179,10 @@
#define SIGUSR1 30
#define SIGUSR2 31
/* MinW has gettimeofday(), but MSVC doesn't */
/* MinGW has gettimeofday(), but MSVC doesn't */
#ifdef _MSC_VER
struct timezone;
/* Last parameter not used */
extern int gettimeofday(struct timeval *tp, struct timezone *tzp);
extern int gettimeofday(struct timeval *tp, void *tzp);
#endif
/* for setitimer in backend/port/win32/timer.c */