On cygwin sa_family_t was undeclared, adding the following line:
typedef unsigned short sa_family_t;
to both:
src/port/getaddrinfo.c
src/include/libpq/pqcomm.h
seemed to compile ok but with make check there was one regression 
failure in test privileges (doesn't look realted, but I'm not sure).
Also included for ease of testing is a patch sepratly sent to patches 
for ecpg.
System: Athalon + Win 2k + cygwin 1.3.22 + gcc 3.2
Sun, 15 Jun 2003 16:54:21 +0100
deststar <deststar@blueyonder.co.uk>
sa_family_t in cygwin compile of cvs + regression failure
On Sun, Jun 15, 2003 at 04:54:21PM +0100, deststar wrote:
> On cygwin sa_family_t was undeclared, adding the following line:
> typedef unsigned short sa_family_t;
> to both:
> src/port/getaddrinfo.c
> src/include/libpq/pqcomm.h

Isn't the attached or fixing Cygwin itself a better approach?

> seemed to compile ok but with make check there was one regression 
> failure in test privileges (doesn't look realted, but I'm not sure).

I have also observed similar problems when I (used to) use make check
myself.  This test passes under make installcheck.

BTW, because of the above and the following (from the Cygwin PostgreSQL
README):

    1. make check can generate spurious regression test failures due to
    overflowing the the listen() backlog queue which generates
    connection refused errors.  Note that make installcheck does not
    have this problem since it runs all tests sequentially instead of in
    large concurrent groups.

I no longer use make check even though make installcheck is much less
convenient.

> Also included for ease of testing is a patch sepratly sent to patches 
> for ecpg.

Thanks for the patch!

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6
Mon, 16 Jun 2003 13:38:01 -0400
Jason Tishler <jason@tishler.net>
Re: [HACKERS] sa_family_t in cygwin compile of cvs + regression
	failure
Jason Tishler wrote:
> On Sun, Jun 15, 2003 at 04:54:21PM +0100, deststar wrote:
> 
>>On cygwin sa_family_t was undeclared, adding the following line:
>>typedef unsigned short sa_family_t;
>>to both:
>>src/port/getaddrinfo.c
>>src/include/libpq/pqcomm.h
> 
> 
> Isn't the attached or fixing Cygwin itself a better approach?
> 
> 
Yes it does seem better, attached is a proposed patch to cygwin.h & 
configure.in (incase cygwin gets it in future)
Have tested with make installcheck & it works fine.
If you see no problems I will sumit to patches
thanks,
- Stuart
Wed, 18 Jun 2003 01:09:58 +0100
deststar <deststar@blueyonder.co.uk>
Re: [HACKERS] sa_family_t in cygwin compile of cvs
I am confused why you didn't like the following patch I posted, which
pulls the family data type length right out of the structure, rather than
having to configure it for every OS that doesn't have sa_family_t?

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

deststar wrote:
> Jason Tishler wrote:
> > On Sun, Jun 15, 2003 at 04:54:21PM +0100, deststar wrote:
> > 
> >>On cygwin sa_family_t was undeclared, adding the following line:
> >>typedef unsigned short sa_family_t;
> >>to both:
> >>src/port/getaddrinfo.c
> >>src/include/libpq/pqcomm.h
> > 
> > 
> > Isn't the attached or fixing Cygwin itself a better approach?
> > 
> > 
> Yes it does seem better, attached is a proposed patch to cygwin.h & 
> configure.in (incase cygwin gets it in future)
> Have tested with make installcheck & it works fine.
> If you see no problems I will sumit to patches
> thanks,

-- 
  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/libpq/pqcomm.h
===================================================================
RCS file: /cvsroot/pgsql-server/src/include/libpq/pqcomm.h,v
retrieving revision 1.86
diff -c -c -r1.86 pqcomm.h
*** src/include/libpq/pqcomm.h	12 Jun 2003 07:36:51 -0000	1.86
--- src/include/libpq/pqcomm.h	16 Jun 2003 21:11:09 -0000
***************
*** 43,57 ****
  /*
   * Definitions used for sockaddr_storage structure paddings design.
   */
! #define	_SS_PAD1SIZE	(_SS_ALIGNSIZE - sizeof (sa_family_t))
! #define	_SS_PAD2SIZE	(_SS_MAXSIZE - (sizeof (sa_family_t) + \
  				_SS_PAD1SIZE + _SS_ALIGNSIZE))
  
  struct sockaddr_storage {
  #ifdef SALEN
      uint8_t	__ss_len;        /* address length */
  #endif
!     sa_family_t	ss_family;	/* address family */
  
      char	__ss_pad1[_SS_PAD1SIZE];
  		/* 6 byte pad, this is to make implementation
--- 43,60 ----
  /*
   * Definitions used for sockaddr_storage structure paddings design.
   */
! /* Some platforms don't have sa_family_t, so we compute it ourselves */
! #define SIZEOF_SOCKADDR_FAMILY		sizeof(((struct sockaddr *)0)->sa_family)
! 
! #define	_SS_PAD1SIZE	(_SS_ALIGNSIZE - SIZEOF_SOCKADDR_FAMILY)
! #define	_SS_PAD2SIZE	(_SS_MAXSIZE - (SIZEOF_SOCKADDR_FAMILY + \
  				_SS_PAD1SIZE + _SS_ALIGNSIZE))
  
  struct sockaddr_storage {
  #ifdef SALEN
      uint8_t	__ss_len;        /* address length */
  #endif
!     char dummy_sa_family[SIZEOF_SOCKADDR_FAMILY];
  
      char	__ss_pad1[_SS_PAD1SIZE];
  		/* 6 byte pad, this is to make implementation
Tue, 17 Jun 2003 21:12:56 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] sa_family_t in cygwin compile of cvs
Sorry didn't see it (& still can't in my inbox - where was it sent?)
Mine was a hack based on reading that sa_family_t should be 16 bits (in 
RFC 2553 IIRC) to solve a cygwin specific problem.
If you have a general solution then that is much better than mine
thank you,
- Stuart

Bruce Momjian wrote:
> I am confused why you didn't like the following patch I posted, which
> pulls the family data type length right out of the structure, rather than
> having to configure it for every OS that doesn't have sa_family_t?
> 
> ---------------------------------------------------------------------------
> 
> deststar wrote:
> 
>>Jason Tishler wrote:
>>
>>>On Sun, Jun 15, 2003 at 04:54:21PM +0100, deststar wrote:
>>>
>>>
>>>>On cygwin sa_family_t was undeclared, adding the following line:
>>>>typedef unsigned short sa_family_t;
>>>>to both:
>>>>src/port/getaddrinfo.c
>>>>src/include/libpq/pqcomm.h
>>>
>>>
>>>Isn't the attached or fixing Cygwin itself a better approach?
>>>
>>>
>>
>>Yes it does seem better, attached is a proposed patch to cygwin.h & 
>>configure.in (incase cygwin gets it in future)
>>Have tested with make installcheck & it works fine.
>>If you see no problems I will sumit to patches
>>thanks,
> 
> 



Wed, 18 Jun 2003 08:30:41 +0100
deststar <deststar@blueyonder.co.uk>
Re: [HACKERS] sa_family_t in cygwin compile of cvs

deststar, is there any sa_family or ss_family in the cygwin include
directory, perhap with double leading underscores?

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

deststar wrote:
> Jason Tishler wrote:
> > On Sun, Jun 15, 2003 at 04:54:21PM +0100, deststar wrote:
> > 
> >>On cygwin sa_family_t was undeclared, adding the following line:
> >>typedef unsigned short sa_family_t;
> >>to both:
> >>src/port/getaddrinfo.c
> >>src/include/libpq/pqcomm.h
> > 
> > 
> > Isn't the attached or fixing Cygwin itself a better approach?
> > 
> > 
> Yes it does seem better, attached is a proposed patch to cygwin.h & 
> configure.in (incase cygwin gets it in future)
> Have tested with make installcheck & it works fine.
> If you see no problems I will sumit to patches
> thanks,
> - Stuart

> *** src/include/port/cygwin.h.orig	Thu May 22 18:20:28 2003
> --- src/include/port/cygwin.h	Tue Jun 17 22:31:04 2003
> ***************
> *** 21,23 ****
> --- 21,28 ----
>   #else
>   #define DLLIMPORT __declspec (dllimport)
>   #endif
> + 
> + #ifndef HAVE_SA_FAMILY_T
> + typedef unsigned short sa_family_t;
> + #endif
> + 

> *** configure.in.orig	Sun Jun 15 05:07:58 2003
> --- configure.in	Tue Jun 17 22:22:24 2003
> ***************
> *** 855,860 ****
> --- 855,866 ----
>   [$ac_includes_default
>   #include <netinet/in.h>])
>   
> + AC_CHECK_TYPE(sa_family_t,
> +               [AC_DEFINE(HAVE_SA_FAMILY_T,1,[Cygwin does not have sa_family_t defined so test])],
> +               [], 
> + 	      [$ac_includes_default
> +               #include <netinet/in.h>])
> + 
>   AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
>   [AC_TRY_LINK(
>   [#include <machine/vmparam.h>

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  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

Mon, 23 Jun 2003 19:04:00 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] sa_family_t in cygwin compile of cvs
Yes there's:
struct sockaddr {
   unsigned short	sa_family;	/* address family, AF_xxx	*/
   char			sa_data[14];	/* 14 bytes of protocol address	*/
};
in socket.h

struct sockaddr {
	u_short sa_family;
	char	sa_data[14];
};
in winsock.h & winsock2.h

typedef struct sockaddr_ipx {
	short sa_family;
	char sa_netnum[4];
	char sa_nodenum[6];
	unsigned short sa_socket;
} SOCKADDR_IPX, *PSOCKADDR_IPX, *LPSOCKADDR_IPX;
in wsipx.h

and for ss_family:
struct sockaddr_storage {
     short ss_family;
     char __ss_pad1[6];    /* pad to 8 */
     __int64 __ss_align; /* force alignment */
     char __ss_pad2[112];  /* pad to 128 */
};
in winsock2.h

To be honest I'm not at all sure about the correctness of my patch as I 
don't know what sa_family is for, I just did a search on google and 
unsigned short seemd to be the answer & it seemed to pass the regression 
test.
regards,
- Stuart

Bruce Momjian wrote:

> deststar, is there any sa_family or ss_family in the cygwin include
> directory, perhap with double leading underscores?
> 
> ---------------------------------------------------------------------------
> 
> deststar wrote:
> 
>>Jason Tishler wrote:
>>
>>>On Sun, Jun 15, 2003 at 04:54:21PM +0100, deststar wrote:
>>>
>>>
>>>>On cygwin sa_family_t was undeclared, adding the following line:
>>>>typedef unsigned short sa_family_t;
>>>>to both:
>>>>src/port/getaddrinfo.c
>>>>src/include/libpq/pqcomm.h
>>>
>>>
>>>Isn't the attached or fixing Cygwin itself a better approach?
>>>
>>>
>>
>>Yes it does seem better, attached is a proposed patch to cygwin.h & 
>>configure.in (incase cygwin gets it in future)
>>Have tested with make installcheck & it works fine.
>>If you see no problems I will sumit to patches
>>thanks,
>>- Stuart
> 
> 
>>*** src/include/port/cygwin.h.orig	Thu May 22 18:20:28 2003
>>--- src/include/port/cygwin.h	Tue Jun 17 22:31:04 2003
>>***************
>>*** 21,23 ****
>>--- 21,28 ----
>>  #else
>>  #define DLLIMPORT __declspec (dllimport)
>>  #endif
>>+ 
>>+ #ifndef HAVE_SA_FAMILY_T
>>+ typedef unsigned short sa_family_t;
>>+ #endif
>>+ 
> 
> 
>>*** configure.in.orig	Sun Jun 15 05:07:58 2003
>>--- configure.in	Tue Jun 17 22:22:24 2003
>>***************
>>*** 855,860 ****
>>--- 855,866 ----
>>  [$ac_includes_default
>>  #include <netinet/in.h>])
>>  
>>+ AC_CHECK_TYPE(sa_family_t,
>>+               [AC_DEFINE(HAVE_SA_FAMILY_T,1,[Cygwin does not have sa_family_t defined so test])],
>>+               [], 
>>+ 	      [$ac_includes_default
>>+               #include <netinet/in.h>])
>>+ 
>>  AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
>>  [AC_TRY_LINK(
>>  [#include <machine/vmparam.h>
> 



Tue, 24 Jun 2003 00:43:48 +0100
deststar <deststar@blueyonder.co.uk>
Re: [HACKERS] sa_family_t in cygwin compile of cvs

OK, I just applied a patch which should fix cygwin too.  Please give it
a try.  Thanks.

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

deststar wrote:
> Yes there's:
> struct sockaddr {
>    unsigned short	sa_family;	/* address family, AF_xxx	*/
>    char			sa_data[14];	/* 14 bytes of protocol address	*/
> };
> in socket.h
> 
> struct sockaddr {
> 	u_short sa_family;
> 	char	sa_data[14];
> };
> in winsock.h & winsock2.h
> 
> typedef struct sockaddr_ipx {
> 	short sa_family;
> 	char sa_netnum[4];
> 	char sa_nodenum[6];
> 	unsigned short sa_socket;
> } SOCKADDR_IPX, *PSOCKADDR_IPX, *LPSOCKADDR_IPX;
> in wsipx.h
> 
> and for ss_family:
> struct sockaddr_storage {
>      short ss_family;
>      char __ss_pad1[6];    /* pad to 8 */
>      __int64 __ss_align; /* force alignment */
>      char __ss_pad2[112];  /* pad to 128 */
> };
> in winsock2.h
> 
> To be honest I'm not at all sure about the correctness of my patch as I 
> don't know what sa_family is for, I just did a search on google and 
> unsigned short seemd to be the answer & it seemed to pass the regression 
> test.
> regards,
> - Stuart
> 
> Bruce Momjian wrote:
> 
> > deststar, is there any sa_family or ss_family in the cygwin include
> > directory, perhap with double leading underscores?
> > 
> > ---------------------------------------------------------------------------
> > 
> > deststar wrote:
> > 
> >>Jason Tishler wrote:
> >>
> >>>On Sun, Jun 15, 2003 at 04:54:21PM +0100, deststar wrote:
> >>>
> >>>
> >>>>On cygwin sa_family_t was undeclared, adding the following line:
> >>>>typedef unsigned short sa_family_t;
> >>>>to both:
> >>>>src/port/getaddrinfo.c
> >>>>src/include/libpq/pqcomm.h
> >>>
> >>>
> >>>Isn't the attached or fixing Cygwin itself a better approach?
> >>>
> >>>
> >>
> >>Yes it does seem better, attached is a proposed patch to cygwin.h & 
> >>configure.in (incase cygwin gets it in future)
> >>Have tested with make installcheck & it works fine.
> >>If you see no problems I will sumit to patches
> >>thanks,
> >>- Stuart
> > 
> > 
> >>*** src/include/port/cygwin.h.orig	Thu May 22 18:20:28 2003
> >>--- src/include/port/cygwin.h	Tue Jun 17 22:31:04 2003
> >>***************
> >>*** 21,23 ****
> >>--- 21,28 ----
> >>  #else
> >>  #define DLLIMPORT __declspec (dllimport)
> >>  #endif
> >>+ 
> >>+ #ifndef HAVE_SA_FAMILY_T
> >>+ typedef unsigned short sa_family_t;
> >>+ #endif
> >>+ 
> > 
> > 
> >>*** configure.in.orig	Sun Jun 15 05:07:58 2003
> >>--- configure.in	Tue Jun 17 22:22:24 2003
> >>***************
> >>*** 855,860 ****
> >>--- 855,866 ----
> >>  [$ac_includes_default
> >>  #include <netinet/in.h>])
> >>  
> >>+ AC_CHECK_TYPE(sa_family_t,
> >>+               [AC_DEFINE(HAVE_SA_FAMILY_T,1,[Cygwin does not have sa_family_t defined so test])],
> >>+               [], 
> >>+ 	      [$ac_includes_default
> >>+               #include <netinet/in.h>])
> >>+ 
> >>  AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
> >>  [AC_TRY_LINK(
> >>  [#include <machine/vmparam.h>
> > 
> 
> 
> 
> ---------------------------(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

Mon, 23 Jun 2003 19:51:36 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] sa_family_t in cygwin compile of cvs

You might still have a problem with compiling getaddrinfo.c.  Please let
me know and I can correct it.

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

deststar wrote:
> On cygwin sa_family_t was undeclared, adding the following line:
> typedef unsigned short sa_family_t;
> to both:
> src/port/getaddrinfo.c
> src/include/libpq/pqcomm.h
> seemed to compile ok but with make check there was one regression 
> failure in test privileges (doesn't look realted, but I'm not sure).
> Also included for ease of testing is a patch sepratly sent to patches 
> for ecpg.
> System: Athalon + Win 2k + cygwin 1.3.22 + gcc 3.2

> *** ./expected/privileges.out	Wed May 14 04:26:04 2003
> --- ./results/privileges.out	Sun Jun 15 16:12:34 2003
> ***************
> *** 10,18 ****
> --- 10,22 ----
>   CREATE GROUP regressgroup1;
>   CREATE GROUP regressgroup2 WITH USER regressuser1, regressuser2;
>   ALTER GROUP regressgroup1 ADD USER regressuser4;
> + WARNING:  AbortTransaction and not in in-progress state
> + ERROR:  rename /home/Administrator/pgcvs/pgsql/src/test/regress/./tmp_check/data/global/pg_group.2284 to /home/Administrator/pgcvs/pgsql/src/test/regress/./tmp_check/data/global/pg_group: Permission denied
>   ALTER GROUP regressgroup2 ADD USER regressuser2;	-- duplicate
>   WARNING:  ALTER GROUP: user "regressuser2" is already in group "regressgroup2"
>   ALTER GROUP regressgroup2 DROP USER regressuser2;
> + WARNING:  AbortTransaction and not in in-progress state
> + ERROR:  rename /home/Administrator/pgcvs/pgsql/src/test/regress/./tmp_check/data/global/pg_group.2284 to /home/Administrator/pgcvs/pgsql/src/test/regress/./tmp_check/data/global/pg_group: Permission denied
>   ALTER GROUP regressgroup2 ADD USER regressuser4;
>   -- test owner privileges
>   SET SESSION AUTHORIZATION regressuser1;
> 
> ======================================================================
> 

> *** src/interfaces/ecpg/compatlib/Makefile.orig	Thu May 22 18:20:44 2003
> --- src/interfaces/ecpg/compatlib/Makefile	Sun Jun 15 15:45:34 2003
> ***************
> *** 17,23 ****
>   SO_MINOR_VERSION= 0.0
>   
>   override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
> ! SHLIB_LINK = -L../pgtypeslib -lpgtypes
>   
>   OBJS= informix.o
>   
> --- 17,23 ----
>   SO_MINOR_VERSION= 0.0
>   
>   override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
> ! SHLIB_LINK = -L../pgtypeslib -lpgtypes -L../ecpglib -lecpg
>   
>   OBJS= informix.o
>   

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  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

Mon, 23 Jun 2003 19:59:48 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] sa_family_t in cygwin compile of cvs + regression
	failure
I still seem to get a compile problem (included below).
Will double check tomorrow when not so tired (02:15 here).
Cheers,
- Stuart
P.S. My server seems to be blacklisted as a spam server by you. Please 
could you white list me.

gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations 
-I../../../../src/i
nclude  -DBUILDING_DLL  -c -o printtup.o printtup.c -MMD
In file included from ../../../../src/include/libpq/libpq-be.h:22,
                  from ../../../../src/include/libpq/libpq.h:21,
                  from printtup.c:20:
../../../../src/include/libpq/pqcomm.h:54: parse error before "sa_family_t"
../../../../src/include/libpq/pqcomm.h:54: warning: no semicolon at end 
of struc
t or union
../../../../src/include/libpq/pqcomm.h:56: `sa_family_t' undeclared here 
(not in
  a function)
../../../../src/include/libpq/pqcomm.h:63: `sa_family_t' undeclared here 
(not in
  a function)
../../../../src/include/libpq/pqcomm.h:63: `sa_family_t' undeclared here 
(not in
  a function)
../../../../src/include/libpq/pqcomm.h:67: parse error before '}' token
../../../../src/include/libpq/pqcomm.h:77: field `addr' has incomplete type
../../../../src/include/libpq/pqcomm.h:79: confused by earlier errors, 
bailing o
ut
make[4]: *** [printtup.o] Error 1



Tue, 24 Jun 2003 02:16:38 +0100
deststar <deststar@blueyonder.co.uk>
Re: [HACKERS] sa_family_t in cygwin compile of cvs + regression
	failure
deststar wrote:
> I still seem to get a compile problem (included below).
> Will double check tomorrow when not so tired (02:15 here).
> Cheers,
> - Stuart
> P.S. My server seems to be blacklisted as a spam server by you. Please 
> could you white list me.
> 
> gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations 
> -I../../../../src/i
> nclude  -DBUILDING_DLL  -c -o printtup.o printtup.c -MMD
> In file included from ../../../../src/include/libpq/libpq-be.h:22,
>                   from ../../../../src/include/libpq/libpq.h:21,
>                   from printtup.c:20:
> ../../../../src/include/libpq/pqcomm.h:54: parse error before "sa_family_t"
> ../../../../src/include/libpq/pqcomm.h:54: warning: no semicolon at end 
> of struc
> t or union
> ../../../../src/include/libpq/pqcomm.h:56: `sa_family_t' undeclared here 
> (not in
>   a function)
> ../../../../src/include/libpq/pqcomm.h:63: `sa_family_t' undeclared here 
> (not in
>   a function)
> ../../../../src/include/libpq/pqcomm.h:63: `sa_family_t' undeclared here 
> (not in
>   a function)
> ../../../../src/include/libpq/pqcomm.h:67: parse error before '}' token
> ../../../../src/include/libpq/pqcomm.h:77: field `addr' has incomplete type
> ../../../../src/include/libpq/pqcomm.h:79: confused by earlier errors, 
> bailing o
> ut
> make[4]: *** [printtup.o] Error 1
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 

-- 
  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/libpq/pqcomm.h
===================================================================
RCS file: /cvsroot/pgsql-server/src/include/libpq/pqcomm.h,v
retrieving revision 1.87
diff -c -c -r1.87 pqcomm.h
*** src/include/libpq/pqcomm.h	23 Jun 2003 23:51:59 -0000	1.87
--- src/include/libpq/pqcomm.h	24 Jun 2003 01:48:40 -0000
***************
*** 47,52 ****
--- 47,56 ----
  #define	_SS_PAD2SIZE	(_SS_MAXSIZE - (sizeof (sa_family_t) + \
  				_SS_PAD1SIZE + _SS_ALIGNSIZE))
  
+ #ifdef __CYGWIN__
+ typedef unsigned short sa_family_t;
+ #endif
+ 
  struct sockaddr_storage {
  #ifdef SALEN
      uint8_t	__ss_len;        /* address length */
Mon, 23 Jun 2003 21:49:42 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] sa_family_t in cygwin compile of cvs + regression
	failure
OK, patch applied to typedef sa_family_t for cygwin.  If other platforms
need it, I will have to do something more generic.

Thanks for the testing.  Block removed, though I did have that ISP
marked as cronic, so there must have been a bunch of spam from there,
not just a few.

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

deststar wrote:
> I still seem to get a compile problem (included below).
> Will double check tomorrow when not so tired (02:15 here).
> Cheers,
> - Stuart
> P.S. My server seems to be blacklisted as a spam server by you. Please 
> could you white list me.
> 
> gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations 
> -I../../../../src/i
> nclude  -DBUILDING_DLL  -c -o printtup.o printtup.c -MMD
> In file included from ../../../../src/include/libpq/libpq-be.h:22,
>                   from ../../../../src/include/libpq/libpq.h:21,
>                   from printtup.c:20:
> ../../../../src/include/libpq/pqcomm.h:54: parse error before "sa_family_t"
> ../../../../src/include/libpq/pqcomm.h:54: warning: no semicolon at end 
> of struc
> t or union
> ../../../../src/include/libpq/pqcomm.h:56: `sa_family_t' undeclared here 
> (not in
>   a function)
> ../../../../src/include/libpq/pqcomm.h:63: `sa_family_t' undeclared here 
> (not in
>   a function)
> ../../../../src/include/libpq/pqcomm.h:63: `sa_family_t' undeclared here 
> (not in
>   a function)
> ../../../../src/include/libpq/pqcomm.h:67: parse error before '}' token
> ../../../../src/include/libpq/pqcomm.h:77: field `addr' has incomplete type
> ../../../../src/include/libpq/pqcomm.h:79: confused by earlier errors, 
> bailing o
> ut
> make[4]: *** [printtup.o] Error 1
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 

-- 
  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/libpq/pqcomm.h
===================================================================
RCS file: /cvsroot/pgsql-server/src/include/libpq/pqcomm.h,v
retrieving revision 1.87
diff -c -c -r1.87 pqcomm.h
*** src/include/libpq/pqcomm.h	23 Jun 2003 23:51:59 -0000	1.87
--- src/include/libpq/pqcomm.h	24 Jun 2003 01:48:40 -0000
***************
*** 47,52 ****
--- 47,56 ----
  #define	_SS_PAD2SIZE	(_SS_MAXSIZE - (sizeof (sa_family_t) + \
  				_SS_PAD1SIZE + _SS_ALIGNSIZE))
  
+ #ifdef __CYGWIN__
+ typedef unsigned short sa_family_t;
+ #endif
+ 
  struct sockaddr_storage {
  #ifdef SALEN
      uint8_t	__ss_len;        /* address length */
Mon, 23 Jun 2003 21:50:49 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] sa_family_t in cygwin compile of cvs + regression
	failure
Bruce,

On Mon, Jun 23, 2003 at 09:50:49PM -0400, Bruce Momjian wrote:
> OK, patch applied to typedef sa_family_t for cygwin.  If other
> platforms need it, I will have to do something more generic.

I'm happy to report that the above patch solves one of Cygwin's current
build problems.  However, Cygwin still needs the following patch:

    http://archives.postgresql.org/pgsql-patches/2003-06/msg00186.php

Thanks,
Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Tue, 24 Jun 2003 08:09:24 -0400
Jason Tishler <jason@tishler.net>
Re: [HACKERS] sa_family_t in cygwin compile of cvs + regression
	failure