Re: Cleaning up historical portability baggage

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Cleaning up historical portability baggage
Дата
Msg-id 148623.1659827307@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Cleaning up historical portability baggage  (Andres Freund <andres@anarazel.de>)
Ответы Re: Cleaning up historical portability baggage  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> Thanks. Next in my quest for reducing autoconf vs meson pg_config.h
> differences is GETTIMEOFDAY stuff.

I just noticed that this could be simplified:

    #ifdef _MSC_VER
    struct timezone;
    /* Last parameter not used */
    extern int    gettimeofday(struct timeval *tp, struct timezone *tzp);
    #endif

because what POSIX actually says is

    int gettimeofday(struct timeval *restrict tp, void *restrict tzp);

and

    If tzp is not a null pointer, the behavior is unspecified.

Indeed, we never call it with anything but a null tzp value,
nor does our Windows fallback implementation do anything with tzp.

So ISTM we should drop the bogus "struct timezone;" and declare
this parameter as "void *tzp".

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: Re: Making autovacuum logs indicate if insert-based threshold was the triggering condition
Следующее
От: Noah Misch
Дата:
Сообщение: Re: failing to build preproc.c on solaris with sun studio