Re: thread-safety: gmtime_r(), localtime_r()

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: thread-safety: gmtime_r(), localtime_r()
Date: 2024-08-16 21:01:43
Message-ID: CA+hUKGJZzf9Bnk9cUpgePS0dZM1Pe_=0Qiyjvn5389qTx=wWVg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Aug 17, 2024 at 3:43 AM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
> I moved the _POSIX_C_SOURCE definition for MinGW from the header file to
> a command-line option (-D_POSIX_C_SOURCE). This matches the treatment
> of _GNU_SOURCE and similar.

I was trying to figure out what else -D_POSIX_C_SOURCE does to MinGW.
Enables __USE_MINGW_ANSI_STDIO, apparently, but I don't know if we
were using that already, or if it matters. I suppose if it ever shows
up as a problem, we can explicitly disable it.

. o O ( MinGW is a strange beast. Do we want to try to keep the code
it runs as close as possible to what is used by MSVC? I thought so,
but we can't always do that due to missing interfaces (though I
suspect that many #ifdef _MSC_VER tests are based on ancient versions
and now bogus). But it also offers ways to be more POSIX-y if we
want, and then we have to decide whether to take them, and make it
more like a separate platform with different quirks... )

> I think this is about as good as it's going to get, and we need it to
> be, so I propose to commit this version if there are no further concerns.

LGTM.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2024-08-16 22:01:42 Re: macOS prefetching support
Previous Message Robert Haas 2024-08-16 20:34:52 Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs