Re: [pgsql-hackers-win32] libpq build problem with on MS VC++ - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [pgsql-hackers-win32] libpq build problem with on MS VC++
Date
Msg-id 200408170424.i7H4Oxc26955@candle.pha.pa.us
Whole thread Raw
In response to Re: [pgsql-hackers-win32] libpq build problem with on MS VC++  (Andrew Francis <locust@familyhealth.com.au>)
Responses Re: [pgsql-hackers-win32] libpq build problem with on MS VC++
List pgsql-patches
Andrew Francis wrote:
> Tom Lane wrote:
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> >
> >>The only other option I can think of is to #undef those to defines,
> >>include io.h, then re-include port.h?  Is that better?
> >
> > How about not #define'ing rename() etc in port.h in the first place?
> >
> > We could put
> >     #ifdef WIN32
> >     #define rename(x) pgrename(x)
> >     #endif
> > into those very few .c files that need it.
>
> How about avoiding #define altogether, and:
>
>   - Always use pgrename/pgunlink instead of rename/unlink
>
>   - Provide stubs for non-Win32 systems
>
> #ifndef WIN32
> int pgrename(const char *from, const char *to) {
>    return rename(from,to);
> }
> #endif
>

We could do it but we have avoided that for cases where Unix would just
be a pass-through.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [pgsql-hackers-win32] libpq build problem with on MS VC++
Next
From: Bruce Momjian
Date:
Subject: Re: [pgsql-hackers-win32] libpq build problem with on MS VC++