Re: Unixware 713 probs

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: ohp(at)pyrenet(dot)fr, pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Unixware 713 probs
Date: 2003-09-07 19:39:24
Message-ID: 245110000.1062963564@lerlaptop.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

--On Sunday, September 07, 2003 14:19:00 -0500 Larry Rosenman
<ler(at)lerctr(dot)org> wrote:

>
>
> --On Sunday, September 07, 2003 20:22:30 +0200 ohp(at)pyrenet(dot)fr wrote:
>
> [snip]
>
>> /usr/local/bin/gmake -C libpq all
>> gmake[3]: Entering directory `/home/postgres/pgsql/src/backend/libpq'
>> cc -O -Kinline,no_host -I../../../src/include -I/usr/local/include -c -o
>> ip.o ip.c UX:acomp: ERROR: "ip.c", line 416: Syntax error before or at: .
>> UX:acomp: WARNING: "ip.c", line 419: left operand of "." must be
>> struct/union object UX:acomp: WARNING: "ip.c", line 427: left operand of
>> "." must be struct/union object UX:acomp: WARNING: "ip.c", line 428: left
>> operand of "." must be struct/union object UX:acomp: WARNING: "ip.c",
>> line 429: left operand of "." must be struct/union object UX:acomp:
>> WARNING: "ip.c", line 430: left operand of "." must be struct/union
>> object UX:acomp: ERROR: "ip.c", line 451: Syntax error before or at: .
>> UX:acomp: ERROR: "ip.c", line 452: invalid type combination
>> UX:acomp: WARNING: "ip.c", line 455: left operand of "." must be
>> struct/union object UX:acomp: WARNING: "ip.c", line 464: left operand of
>> "." must be struct/union object UX:acomp: WARNING: "ip.c", line 465: left
>> operand of "." must be struct/union object UX:acomp: WARNING: "ip.c",
>> line 466: left operand of "." must be struct/union object UX:acomp:
> line 416 is:
>
> int32 s_addr;
>
> s_addr is seen by the compiler as:
>
> uint32 __S_un . __S_addr ;
>
>
> We need to pick another name.
>
> LER
Here's a quickie patch I did to fix it.

Index: src/backend/libpq/ip.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/libpq/ip.c,v
retrieving revision 1.21
diff -u -r1.21 ip.c
--- src/backend/libpq/ip.c 5 Sep 2003 23:07:21 -0000 1.21
+++ src/backend/libpq/ip.c 7 Sep 2003 19:36:06 -0000
@@ -413,10 +413,10 @@
{
struct sockaddr_in addr4;
struct sockaddr_in6 addr6;
- uint32 s_addr;
+ uint32 pg_s_addr;

memcpy(&addr4, addr, sizeof(addr4));
- s_addr = ntohl(addr4.sin_addr.s_addr);
+ pg_s_addr = ntohl(addr4.sin_addr.s_addr);

memset(&addr6, 0, sizeof(addr6));

@@ -424,10 +424,10 @@

addr6.sin6_addr.s6_addr[10] = 0xff;
addr6.sin6_addr.s6_addr[11] = 0xff;
- addr6.sin6_addr.s6_addr[12] = (s_addr >> 24) & 0xFF;
- addr6.sin6_addr.s6_addr[13] = (s_addr >> 16) & 0xFF;
- addr6.sin6_addr.s6_addr[14] = (s_addr >> 8) & 0xFF;
- addr6.sin6_addr.s6_addr[15] = (s_addr) & 0xFF;
+ addr6.sin6_addr.s6_addr[12] = (pg_s_addr >> 24) & 0xFF;
+ addr6.sin6_addr.s6_addr[13] = (pg_s_addr >> 16) & 0xFF;
+ addr6.sin6_addr.s6_addr[14] = (pg_s_addr >> 8) & 0xFF;
+ addr6.sin6_addr.s6_addr[15] = (pg_s_addr) & 0xFF;

memcpy(addr, &addr6, sizeof(addr6));
}
@@ -448,11 +448,11 @@
{
struct sockaddr_in addr4;
struct sockaddr_in6 addr6;
- uint32 s_addr;
+ uint32 pg_s_addr;
int i;

memcpy(&addr4, addr, sizeof(addr4));
- s_addr = ntohl(addr4.sin_addr.s_addr);
+ pg_s_addr = ntohl(addr4.sin_addr.s_addr);

memset(&addr6, 0, sizeof(addr6));

@@ -461,10 +461,10 @@
for (i = 0; i < 12; i++)
addr6.sin6_addr.s6_addr[i] = 0xff;

- addr6.sin6_addr.s6_addr[12] = (s_addr >> 24) & 0xFF;
- addr6.sin6_addr.s6_addr[13] = (s_addr >> 16) & 0xFF;
- addr6.sin6_addr.s6_addr[14] = (s_addr >> 8) & 0xFF;
- addr6.sin6_addr.s6_addr[15] = (s_addr) & 0xFF;
+ addr6.sin6_addr.s6_addr[12] = (pg_s_addr >> 24) & 0xFF;
+ addr6.sin6_addr.s6_addr[13] = (pg_s_addr >> 16) & 0xFF;
+ addr6.sin6_addr.s6_addr[14] = (pg_s_addr >> 8) & 0xFF;
+ addr6.sin6_addr.s6_addr[15] = (pg_s_addr) & 0xFF;

memcpy(addr, &addr6, sizeof(addr6));
}

also on my http://www.lerctr.org/~ler/postgresql page.

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Attachment Content-Type Size
ip.patch application/octet-stream 2.0 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-09-07 19:52:18 Re: Unixware 713 probs
Previous Message Holger Marzen 2003-09-07 19:24:36 Re: Does "vacuum analyze" contain "vacuum"?

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2003-09-07 19:52:18 Re: Unixware 713 probs
Previous Message Larry Rosenman 2003-09-07 19:18:59 Re: Unixware 713 probs

Browse pgsql-patches by date

  From Date Subject
Next Message Stephan Szabo 2003-09-07 19:52:18 Re: Unixware 713 probs
Previous Message Larry Rosenman 2003-09-07 19:18:59 Re: Unixware 713 probs