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

Re: Compiling libpq with VisualC

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>,PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Compiling libpq with VisualC
Date: 2004-06-20 01:13:18
Message-ID: 200406200113.i5K1DIq21928@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
Tom Lane wrote:
> Andreas Pflug <pgadmin(at)pse-consulting(dot)de> writes:
> > <sys/time.h> in libpq-be.h isn't present on win32 vc6. Apparently, it 
> > isn't used in Linux either; libpq will compile without it.
> 
> It's there to declare struct timeval, and I'm fairly certain that diking
> it out of the header would break things on some platforms.  Where does
> Windows define struct timeval?
>  
> > +#ifndef WIN32
> >  #include <sys/time.h>
> > +#endif
> 
> Could we please use HAVE_SYS_TIME_H, rather than creating an unnecessary
> platform specificity?

The problem is that they are building from win32.mak, and don't run
configure at all.  Mingw does have it so we can't just skip including
it.  I think we should test for the MS compiler in this case.  Please
test for _MSC_VER instead of WIN32 and let us know how it works.

> >  #ifndef ELOG_H
> >  #define ELOG_H
>  
> > +#ifdef ERROR
> > +#undef ERROR    /* possible conflict in win32 */
> > +#endif
> > +
> >  /* Error level codes */
> 
> This seems likely to break anything expecting the Win32 definition
> of ERROR.  Can we look at not including elog.h in frontend builds,
> instead?  I can't think of any reason for frontend code to need it.

Agreed.  We define FRONTEND when compiling libpq.  Please test for that
and send another patch.

Thanks.

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

In response to

Responses

pgsql-hackers by date

Next:From: John HansenDate: 2004-06-20 01:27:36
Subject: Re: Cannot initdb in cvs tip
Previous:From: Bruce MomjianDate: 2004-06-20 00:15:46
Subject: Re: Tablespace patch review

pgsql-patches by date

Next:From: John HansenDate: 2004-06-20 01:27:36
Subject: Re: Cannot initdb in cvs tip
Previous:From: Bruce MomjianDate: 2004-06-20 00:59:12
Subject: Re: eventlog fix

pgsql-hackers-win32 by date

Next:From: John HansenDate: 2004-06-20 01:27:36
Subject: Re: Cannot initdb in cvs tip
Previous:From: Dave PageDate: 2004-06-19 22:04:38
Subject: Re: Cannot initdb in cvs tip

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