Michael Paquier <mich...@paquier.xyz> writes: > On Wed, Sep 12, 2018 at 12:47:31PM +0900, Michael Paquier wrote: >> That's exactly what I would like to do and what I meant two paragraphs >> above as that's the only solution I think would be clean, and this would >> take care of st_size nicely. I have not tested (yet), but some tweaks >> in win32_port.h could be enough before mapping lstat to stat?
> FWIW, I have been digging into this one and as "struct stat" is already > an existing structure when it comes to MSVC, enforcing a mapping of > __stat64 to that is proving to be tedious in one of the port headers. Yeah, I was afraid of that. We could invent a typedef "pg_struct_stat" that maps to the right thing, but using that everywhere would be a mighty invasive change :-(. And we can't just "#define stat __stat64" because that would break the calls to stat(). Or wait, maybe we could do that and also have a one-liner function named __stat64 that would catch the calls and redirect to _stat64? regards, tom lane