Обсуждение: Re: Beta5 libpq Build broken with MS .NET 2

Поиск
Список
Период
Сортировка

Re: Beta5 libpq Build broken with MS .NET 2

От
Claudio Natoli
Дата:
Hello Tony,

the problem here is that the MS compiler has no definition of pid_t. Adding
a line like:
  typedef int pid_t;
to src\include\port\win32.h before line 111 will get you past this.

It appears that you'll also need to comment out:
 #include <unistd.h>
at line 24 of src\interfaces\libpq\fe-connect.c in order to complete the
libpq build (under VC++ at least). Lastly, psql builds with a whole host of
warnings, but appears functional.

To the community at large, I've been out of touch for a while so not sure
how best to patch, but I HTH.

Cheers,
Claudio


-----Original Message-----
From: Tony and Bryn Reina [mailto:reina_ga@hotmail.com]
Sent: Monday, 22 November 2004 8:59 PM
To: pgsql-hackers-win32@postgresql.org
Subject: [pgsql-hackers-win32] Beta5 libpq Build broken with MS .NET 2003


I just downloaded 8.0beta5 to see if I could build libpq.dll with MS Visual
Studio .NET 2003 on Windows XP. The make file throws the error:

Building the Win32 static library...

        copy pthread.h.win32 pthread.h
        1 file(s) copied.
        echo #define SYSCONFDIR "" >pg_config_paths.h
        if not exist ".\Release/" mkdir ".\Release"
        cl.exe @C:\DOCUME~1\Tony\LOCALS~1\Temp\nm32F.tmp
getaddrinfo.c
c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) :
error C2146: syntax error : missing ')' before identifier 'pid'
c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) :
error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) :
error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) :
error C2143: syntax error : missing ')' before 'identifier'
c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) :
error C2061: syntax error : identifier 'pid'
c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) :
error C2059: syntax error : ';'
c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32h(111) :
error C2059: syntax error : ')'
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio .NET
2003\VC7\BIN\nmake.exe"' : return code '0x2'
Stop.


I looked at the offending line in win32.h and don't immediately see any
errors with the ). Tried adding a ) before pid, but that causes more errors.
Perhaps someone smarter can see where the problem is.

-Tony

Re: Beta5 libpq Build broken with MS .NET 2003

От
"Tony and Bryn Reina"
Дата:
Thanks Claudio. The DLL compiles with those changes. Hopefully one of the
committers can make the appropriate patch.

-Tony

----- Original Message -----
From: "Claudio Natoli" <claudio.natoli@memetrics.com>
To: "'Tony and Bryn Reina'" <reina_ga@hotmail.com>;
<pgsql-hackers-win32@postgresql.org>
Sent: Tuesday, November 23, 2004 12:01 AM
Subject: RE: [pgsql-hackers-win32] Beta5 libpq Build broken with MS .NET
2003


>
> Hello Tony,
>
> the problem here is that the MS compiler has no definition of pid_t.
> Adding
> a line like:
>  typedef int pid_t;
> to src\include\port\win32.h before line 111 will get you past this.
>
> It appears that you'll also need to comment out:
> #include <unistd.h>
> at line 24 of src\interfaces\libpq\fe-connect.c in order to complete the
> libpq build (under VC++ at least). Lastly, psql builds with a whole host
> of
> warnings, but appears functional.
>
> To the community at large, I've been out of touch for a while so not sure
> how best to patch, but I HTH.
>
> Cheers,
> Claudio
>
>
> -----Original Message-----
> From: Tony and Bryn Reina [mailto:reina_ga@hotmail.com]
> Sent: Monday, 22 November 2004 8:59 PM
> To: pgsql-hackers-win32@postgresql.org
> Subject: [pgsql-hackers-win32] Beta5 libpq Build broken with MS .NET 2003
>
>
> I just downloaded 8.0beta5 to see if I could build libpq.dll with MS
> Visual
> Studio .NET 2003 on Windows XP. The make file throws the error:
>
> Building the Win32 static library...
>
>        copy pthread.h.win32 pthread.h
>        1 file(s) copied.
>        echo #define SYSCONFDIR "" >pg_config_paths.h
>        if not exist ".\Release/" mkdir ".\Release"
>        cl.exe @C:\DOCUME~1\Tony\LOCALS~1\Temp\nm32F.tmp
> getaddrinfo.c
> c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111)
> :
> error C2146: syntax error : missing ')' before identifier 'pid'
> c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111)
> :
> error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
> c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111)
> :
> error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
> c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111)
> :
> error C2143: syntax error : missing ')' before 'identifier'
> c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111)
> :
> error C2061: syntax error : identifier 'pid'
> c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111)
> :
> error C2059: syntax error : ';'
> c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32h(111) :
> error C2059: syntax error : ')'
> NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio .NET
> 2003\VC7\BIN\nmake.exe"' : return code '0x2'
> Stop.
>
>
> I looked at the offending line in win32.h and don't immediately see any
> errors with the ). Tried adding a ) before pid, but that causes more
> errors.
> Perhaps someone smarter can see where the problem is.
>
> -Tony
>

Re: Beta5 libpq Build broken with MS .NET 2003

От
Bruce Momjian
Дата:
OK, I have applied this patch to make the suggested changes.

---------------------------------------------------------------------------

Tony and Bryn Reina wrote:
> Thanks Claudio. The DLL compiles with those changes. Hopefully one of the 
> committers can make the appropriate patch.
> 
> -Tony
> 
> ----- Original Message ----- 
> From: "Claudio Natoli" <claudio.natoli@memetrics.com>
> To: "'Tony and Bryn Reina'" <reina_ga@hotmail.com>; 
> <pgsql-hackers-win32@postgresql.org>
> Sent: Tuesday, November 23, 2004 12:01 AM
> Subject: RE: [pgsql-hackers-win32] Beta5 libpq Build broken with MS .NET 
> 2003
> 
> 
> >
> > Hello Tony,
> >
> > the problem here is that the MS compiler has no definition of pid_t. 
> > Adding
> > a line like:
> >  typedef int pid_t;
> > to src\include\port\win32.h before line 111 will get you past this.
> >
> > It appears that you'll also need to comment out:
> > #include <unistd.h>
> > at line 24 of src\interfaces\libpq\fe-connect.c in order to complete the
> > libpq build (under VC++ at least). Lastly, psql builds with a whole host 
> > of
> > warnings, but appears functional.
> >
> > To the community at large, I've been out of touch for a while so not sure
> > how best to patch, but I HTH.
> >
> > Cheers,
> > Claudio
> >
> >
> > -----Original Message-----
> > From: Tony and Bryn Reina [mailto:reina_ga@hotmail.com]
> > Sent: Monday, 22 November 2004 8:59 PM
> > To: pgsql-hackers-win32@postgresql.org
> > Subject: [pgsql-hackers-win32] Beta5 libpq Build broken with MS .NET 2003
> >
> >
> > I just downloaded 8.0beta5 to see if I could build libpq.dll with MS 
> > Visual
> > Studio .NET 2003 on Windows XP. The make file throws the error:
> >
> > Building the Win32 static library...
> >
> >        copy pthread.h.win32 pthread.h
> >        1 file(s) copied.
> >        echo #define SYSCONFDIR "" >pg_config_paths.h
> >        if not exist ".\Release/" mkdir ".\Release"
> >        cl.exe @C:\DOCUME~1\Tony\LOCALS~1\Temp\nm32F.tmp
> > getaddrinfo.c
> > c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) 
> > :
> > error C2146: syntax error : missing ')' before identifier 'pid'
> > c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) 
> > :
> > error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
> > c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) 
> > :
> > error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
> > c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) 
> > :
> > error C2143: syntax error : missing ')' before 'identifier'
> > c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) 
> > :
> > error C2061: syntax error : identifier 'pid'
> > c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32.h(111) 
> > :
> > error C2059: syntax error : ';'
> > c:\msys\1.0\home\Tony\postgresql-8.0.0beta5\src\include\port\win32h(111) :
> > error C2059: syntax error : ')'
> > NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
> > Stop.
> > NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio .NET
> > 2003\VC7\BIN\nmake.exe"' : return code '0x2'
> > Stop.
> >
> >
> > I looked at the offending line in win32.h and don't immediately see any
> > errors with the ). Tried adding a ) before pid, but that causes more 
> > errors.
> > Perhaps someone smarter can see where the problem is.
> >
> > -Tony
> > 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html
> 

-- 
  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
Index: src/include/port/win32.h
===================================================================
RCS file: /cvsroot/pgsql/src/include/port/win32.h,v
retrieving revision 1.40
diff -c -c -r1.40 win32.h
*** src/include/port/win32.h    17 Nov 2004 00:14:14 -0000    1.40
--- src/include/port/win32.h    1 Dec 2004 23:39:13 -0000
***************
*** 210,215 ****
--- 210,219 ----
  #endif
  typedef long key_t;
  
+ #ifdef WIN32_CLIENT_ONLY
+ typedef int pid_t;
+ #endif
+ 
  /*
   * Supplement to <sys/stat.h>.
   */
Index: src/interfaces/libpq/fe-connect.c
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v
retrieving revision 1.289
diff -c -c -r1.289 fe-connect.c
*** src/interfaces/libpq/fe-connect.c    30 Oct 2004 23:11:26 -0000    1.289
--- src/interfaces/libpq/fe-connect.c    1 Dec 2004 23:39:19 -0000
***************
*** 20,26 ****
--- 20,28 ----
  #include <fcntl.h>
  #include <ctype.h>
  #include <time.h>
+ #ifndef WIN32_CLIENT_ONLY
  #include <unistd.h>
+ #endif
  
  #ifndef HAVE_STRDUP
  #include "strdup.h"
***************
*** 35,41 ****
  #include "win32.h"
  #else
  #include <sys/socket.h>
- #include <unistd.h>
  #include <netdb.h>
  #include <netinet/in.h>
  #ifdef HAVE_NETINET_TCP_H
--- 37,42 ----