Re: libpq-win32 patches - Mailing list pgsql-patches

From Andreas Pflug
Subject Re: libpq-win32 patches
Date
Msg-id 3F584B53.70500@pse-consulting.de
Whole thread Raw
In response to Re: libpq-win32 patches  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Hi Bruce,


>>
>>+
>>+/* getpwuid doesn't exist under win32 */
>>+#define getpwuid(uid) NULL
>>+
>> #endif /* pg_config_h_win32__ */
>>
>>
>
>Why was this needed?  I realize we don't have getpwuid() on Win32, but
>we do have GetUserName() for cases where we need the name but not the
>directory.
>
>Because all the getpwuid() calls seem ifdef'ed out under Win32 anyway, I
>don't understand why you needed it.
>

I believe it was the first thing I did to have libpq compile at all.
Later, I went into the ssl code and made it work, effectively commenting
out all calls to getpwuid() making that line unnecessary.



>Can't we check the OS version via the compiler?  Maybe not portabily
>between the various compilers supported.
>
>
If you're talking about the WIN32 macro, this should be supported by
every compiler running for win32, because windows headers rely on this.

Regards,
Andreas



pgsql-patches by date:

Previous
From: Andriy Tkachuk
Date:
Subject: Re: doc patch - linux memory handling
Next
From: Andreas Pflug
Date:
Subject: Re: IPV4 addresses on IPV6 machines in pg_hba.conf