pgsql: Simplify gettimeofday for Windows.

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Simplify gettimeofday for Windows.
Date: 2022-08-07 00:36:19
Message-ID: E1oKUHC-000eFz-Um@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/CA%2BhUKGKwRpvGfcfq2qNVAQS2Wg1B9eA9QRhAmVSyJt1zsCN2sQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/24c3ce8f1c707f9eeb1f68cebd44c2516ff799c2

Modified Files
--------------
src/include/port/win32_port.h | 5 ++--
src/port/win32gettimeofday.c | 67 ++++++++-----------------------------------
2 files changed, 14 insertions(+), 58 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2022-08-07 00:45:58 pgsql: Simplify replacement code for strtof.
Previous Message Álvaro Herrera 2022-08-06 20:03:55 Re: pgsql: BRIN: mask BRIN_EVACUATE_PAGE for WAL consistency checking