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

Поиск
Список
Период
Сортировка
От Andrew Francis
Тема Re: [pgsql-hackers-win32] libpq build problem with on MS VC++
Дата
Msg-id 412187C1.2060606@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: [pgsql-hackers-win32] libpq build problem with on MS VC++  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [pgsql-hackers-win32] libpq build problem with on MS VC++  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
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

#define is evil, afterall.

--
Andrew Francis
Lead Developer - Software
Family Health Network


В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [pgsql-hackers-win32] libpq build problem with on MS VC++
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [pgsql-hackers-win32] libpq build problem with on MS VC++