Client build of MSVC6+ patch

Started by Hiroshi Saitoabout 20 years ago16 messagespatches
Jump to latest
#1Hiroshi Saito
z-saito@guitar.ocn.ne.jp

Hi Bruce-san, and Magnus-san.

I take out patch for this as a promise.
This is client-build support of MS-VC6+.
However, It leaves the problem of IPV6.:-(

Regards,
Hiroshi Saito

Attachments:

msvc_patchapplication/octet-stream; name=msvc_patchDownload+34-3
#2Magnus Hagander
magnus@hagander.net
In reply to: Hiroshi Saito (#1)
Re: Client build of MSVC6+ patch

Hi Bruce-san, and Magnus-san.

I take out patch for this as a promise.
This is client-build support of MS-VC6+.
However, It leaves the problem of IPV6.:-(

Hi!

This patch looks a lot better to me.

What is the problem with IPV6? Did I break that with my changes to
getaddrinfo.c, or is it something else?

//Magnus

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Magnus Hagander (#2)
Re: Client build of MSVC6+ patch

Magnus Hagander wrote:

What is the problem with IPV6? Did I break that with my changes to
getaddrinfo.c, or is it something else?

If IPv6 gets broken after all the trouble several of us went to I'll be
annoyed. :-)

cheers

andrew

#4Andrew Dunstan
andrew@dunslane.net
In reply to: Andrew Dunstan (#3)
Re: Client build of MSVC6+ patch

Hiroshi Saito said:

Hi.

If IPv6 gets broken after all the trouble several of us went to I'll
be annoyed. :-)

Um, I think that this was the origin in problem.:-)

Why do we need to reorder the fields in the struct?

cheers

andrew

#5Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Magnus Hagander (#2)
Re: Client build of MSVC6+ patch

Hi.

If IPv6 gets broken after all the trouble several of us went to I'll be
annoyed. :-)

Um, I think that this was the origin in problem.:-)

Regards,
Hiroshi Saito

Attachments:

getaddrinfo_patchapplication/octet-stream; name=getaddrinfo_patchDownload+3-1
#6Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Hiroshi Saito (#5)
Re: Client build of MSVC6+ patch

Hi.

If IPv6 gets broken after all the trouble several of us went to I'll
be annoyed. :-)

Um, I think that this was the origin in problem.:-)

Why do we need to reorder the fields in the struct?

Eh? Even my FreeBSD used well shows a structure object.
(FreeBSD)
/usr/include/netdb.h
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
int ai_family; /* PF_xxx */
int ai_socktype; /* SOCK_xxx */
int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
size_t ai_addrlen; /* length of ai_addr */
char *ai_canonname; /* canonical name for hostname */
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};

Then, It was helped actually.

Regards,
Hiroshi Saito

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Saito (#6)
Re: Client build of MSVC6+ patch

"Hiroshi Saito" <z-saito@guitar.ocn.ne.jp> writes:

Why do we need to reorder the fields in the struct?

Eh? Even my FreeBSD used well shows a structure object.

The standard lists the fields in the other order:
http://www.opengroup.org/onlinepubs/009695399/basedefs/netdb.h.html

Even though the standard doesn't say that that has to be the physical
order, every other platform besides Windows does it that way. The patch
as given is unacceptable because it *will* break other platforms (mine
for instance ;-)). If it has to be this way for Windows then we need
some sort of platform-specific #ifdef. Considering that the code works
as-is on several sorts of Windows builds, we probably need something
even more specific than that, like #if MSVC-before-version-XX.

regards, tom lane

#8Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Hiroshi Saito (#5)
Re: Client build of MSVC6+ patch

Hi. Tom-san.

Oops, I understood it. Thank you for suggestion.
What condition is this?

Regards,
Hiroshi Saito

From: "Tom Lane"

Show quoted text

"Hiroshi Saito" <z-saito@guitar.ocn.ne.jp> writes:

Why do we need to reorder the fields in the struct?

Eh? Even my FreeBSD used well shows a structure object.

The standard lists the fields in the other order:
http://www.opengroup.org/onlinepubs/009695399/basedefs/netdb.h.html

Even though the standard doesn't say that that has to be the physical
order, every other platform besides Windows does it that way. The patch
as given is unacceptable because it *will* break other platforms (mine
for instance ;-)). If it has to be this way for Windows then we need
some sort of platform-specific #ifdef. Considering that the code works
as-is on several sorts of Windows builds, we probably need something
even more specific than that, like #if MSVC-before-version-XX.

regards, tom lane

Attachments:

getaddrinfo_patch2application/octet-stream; name=getaddrinfo_patch2Download+15-0
#9Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#7)
Re: Client build of MSVC6+ patch

Why do we need to reorder the fields in the struct?

Eh? Even my FreeBSD used well shows a structure object.

The standard lists the fields in the other order:
http://www.opengroup.org/onlinepubs/009695399/basedefs/netdb.h.html

Even though the standard doesn't say that that has to be the
physical order, every other platform besides Windows does it
that way. The patch as given is unacceptable because it
*will* break other platforms (mine for instance ;-)). If it
has to be this way for Windows then we need some sort of
platform-specific #ifdef. Considering that the code works
as-is on several sorts of Windows builds, we probably need
something even more specific than that, like #if
MSVC-before-version-XX.

Haven't dug into the details, but it just feels a bit off that this
shuold be depending on the compiler. MSVC6 and MingW uses the same
runtime library, and I would've expected it to be more depending on that
than on the compiler itself?

That said, where does the problem actually show up, Hiroshi? If it's
just at runtime, I'm not so sure it works on MingW - AFAIK it's at least
not tested on the buildfarm. And I haven't tested IPV6 on newer versions
of MSVC.

//Magnus

#10Bruce Momjian
bruce@momjian.us
In reply to: Hiroshi Saito (#8)
Re: Client build of MSVC6+ patch

I am thinking this patch needs to be applied, and the #ifdef test
changed to WIN32 so both MinGW and MSVC use the changed structure
ordering.

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

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

Hiroshi Saito wrote:

Hi. Tom-san.

Oops, I understood it. Thank you for suggestion.
What condition is this?

Regards,
Hiroshi Saito

From: "Tom Lane"

"Hiroshi Saito" <z-saito@guitar.ocn.ne.jp> writes:

Why do we need to reorder the fields in the struct?

Eh? Even my FreeBSD used well shows a structure object.

The standard lists the fields in the other order:
http://www.opengroup.org/onlinepubs/009695399/basedefs/netdb.h.html

Even though the standard doesn't say that that has to be the physical
order, every other platform besides Windows does it that way. The patch
as given is unacceptable because it *will* break other platforms (mine
for instance ;-)). If it has to be this way for Windows then we need
some sort of platform-specific #ifdef. Considering that the code works
as-is on several sorts of Windows builds, we probably need something
even more specific than that, like #if MSVC-before-version-XX.

regards, tom lane

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#11Bruce Momjian
bruce@momjian.us
In reply to: Hiroshi Saito (#1)
Re: Client build of MSVC6+ patch

Patch applied. Thanks.

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

Hiroshi Saito wrote:

Hi Bruce-san, and Magnus-san.

I take out patch for this as a promise.
This is client-build support of MS-VC6+.
However, It leaves the problem of IPV6.:-(

Regards,
Hiroshi Saito

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#12Bruce Momjian
bruce@momjian.us
In reply to: Hiroshi Saito (#8)
Re: Client build of MSVC6+ patch

Patch applied. Change made so test is WIN32, and add comment about
different structure ordering on Win32 for IPv6 use.

Thanks.

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

Hiroshi Saito wrote:

Hi. Tom-san.

Oops, I understood it. Thank you for suggestion.
What condition is this?

Regards,
Hiroshi Saito

From: "Tom Lane"

"Hiroshi Saito" <z-saito@guitar.ocn.ne.jp> writes:

Why do we need to reorder the fields in the struct?

Eh? Even my FreeBSD used well shows a structure object.

The standard lists the fields in the other order:
http://www.opengroup.org/onlinepubs/009695399/basedefs/netdb.h.html

Even though the standard doesn't say that that has to be the physical
order, every other platform besides Windows does it that way. The patch
as given is unacceptable because it *will* break other platforms (mine
for instance ;-)). If it has to be this way for Windows then we need
some sort of platform-specific #ifdef. Considering that the code works
as-is on several sorts of Windows builds, we probably need something
even more specific than that, like #if MSVC-before-version-XX.

regards, tom lane

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#13Andrew Dunstan
andrew@dunslane.net
In reply to: Bruce Momjian (#12)
Re: Client build of MSVC6+ patch

I'm still not very happy - we never got a reply about why the reordering
was needed at all. Referring in some way to FBSD doesn't really answer
for Windows. I am currently without a Windows box I can use, so I am
dependent on asking questions.

cheers

andrew

Bruce Momjian wrote:

Show quoted text

Patch applied. Change made so test is WIN32, and add comment about
different structure ordering on Win32 for IPv6 use.

Thanks.

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

Hiroshi Saito wrote:

Hi. Tom-san.

Oops, I understood it. Thank you for suggestion.
What condition is this?

Regards,
Hiroshi Saito

From: "Tom Lane"

"Hiroshi Saito" <z-saito@guitar.ocn.ne.jp> writes:

Why do we need to reorder the fields in the struct?

Eh? Even my FreeBSD used well shows a structure object.

The standard lists the fields in the other order:
http://www.opengroup.org/onlinepubs/009695399/basedefs/netdb.h.html

Even though the standard doesn't say that that has to be the physical
order, every other platform besides Windows does it that way. The patch
as given is unacceptable because it *will* break other platforms (mine
for instance ;-)). If it has to be this way for Windows then we need
some sort of platform-specific #ifdef. Considering that the code works
as-is on several sorts of Windows builds, we probably need something
even more specific than that, like #if MSVC-before-version-XX.

regards, tom lane

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

#14Petr Jelinek
petr@2ndquadrant.com
In reply to: Andrew Dunstan (#13)
Re: Client build of MSVC6+ patch

Andrew Dunstan wrote:

I'm still not very happy - we never got a reply about why the reordering
was needed at all. Referring in some way to FBSD doesn't really answer
for Windows. I am currently without a Windows box I can use, so I am
dependent on asking questions.

Well, in MSVC addrinfo is defined this way (as in patch) too. MSVC does
even have IPv6 detection in its header files.

--
Regards
Petr Jelinek (PJMODOS)

#15Andrew Dunstan
andrew@dunslane.net
In reply to: Petr Jelinek (#14)
Re: Client build of MSVC6+ patch

Petr Jelinek said:

Andrew Dunstan wrote:

I'm still not very happy - we never got a reply about why the
reordering was needed at all. Referring in some way to FBSD doesn't
really answer for Windows. I am currently without a Windows box I can
use, so I am dependent on asking questions.

Well, in MSVC addrinfo is defined this way (as in patch) too. MSVC does
even have IPv6 detection in its header files.

That's certainly a better answer.

Does the detection work at runtime, or is it static? IIRC we found that
static detection broke the binary portability on Windows.

cheers

andrew

#16Petr Jelinek
petr@2ndquadrant.com
In reply to: Andrew Dunstan (#15)
Re: Client build of MSVC6+ patch

Andrew Dunstan wrote:

Does the detection work at runtime, or is it static? IIRC we found that
static detection broke the binary portability on Windows.

It's runtime just like ours.

--
Regards
Petr Jelinek (PJMODOS)