Skip site navigation (1) Skip section navigation (2)

Re: libpq build problem with <io.h> on MS VC++

From: Andrew Francis <locust(at)familyhealth(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,pgsql-hackers-win32(at)postgresql(dot)org,PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: libpq build problem with <io.h> on MS VC++
Date: 2004-08-17 04:21:21
Message-ID: 412187C1.2060606@familyhealth.com.au (view raw or flat)
Thread:
Lists: pgsql-hackers-win32pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

#define is evil, afterall.

-- 
Andrew Francis
Lead Developer - Software
Family Health Network


In response to

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2004-08-17 04:24:14
Subject: Re: libpq build problem with <io.h> on MS VC++
Previous:From: Bruce MomjianDate: 2004-08-17 04:14:39
Subject: Re: libpq build problem with <io.h> on MS VC++

pgsql-hackers-win32 by date

Next:From: Bruce MomjianDate: 2004-08-17 04:24:14
Subject: Re: libpq build problem with <io.h> on MS VC++
Previous:From: Bruce MomjianDate: 2004-08-17 04:14:39
Subject: Re: libpq build problem with <io.h> on MS VC++

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group