Re: MSVC build broken (again)

Lists: pgsql-hackerspgsql-patches
From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: <pgsql-patches(at)postgresql(dot)org>
Subject: MSVC build broken (again)
Date: 2006-10-03 19:07:12
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA0FC15@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

The code around errcode is definitly messy. In CVS now, it actually
renames *our* errcode() function to __msvc_errcode, and exports this
from postgres.exe. This is definitly very borken.

The check for _MSC_VER > 1400 won't come true until Microsoft releases
the next verison of Visual Studio - VS2005 is 1400, not >1400.

Attached patch fixes this. Tested on MSVC and on Mingw.

//Magnus

Attachment Content-Type Size
vcbuild.diff application/octet-stream 1.3 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: MSVC build broken (again)
Date: 2006-10-03 20:01:20
Message-ID: 10542.1159905680@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

"Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
> The code around errcode is definitly messy. In CVS now, it actually
> renames *our* errcode() function to __msvc_errcode, and exports this
> from postgres.exe. This is definitly very borken.

Would it be possible to move the whole <crtdefs.h> block into win32.h?
This would cause it to be included after <stdio.h> and friends, which
maybe is too late, but taking it out of c.h would be a lot cleaner.

regards, tom lane


From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: MSVC build broken (again)
Date: 2006-10-03 20:13:20
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA0FC1A@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> > The code around errcode is definitly messy. In CVS now, it actually
> > renames *our* errcode() function to __msvc_errcode, and
> exports this
> > from postgres.exe. This is definitly very borken.
>
> Would it be possible to move the whole <crtdefs.h> block into win32.h?
> This would cause it to be included after <stdio.h> and
> friends, which maybe is too late, but taking it out of c.h
> would be a lot cleaner.

Nope, it needs to go before <stdio.h> and friends, unfortunatly.

//Magnus


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: MSVC build broken (again)
Date: 2006-10-03 20:36:13
Message-ID: 10793.1159907773@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

"Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
>> Would it be possible to move the whole <crtdefs.h> block into win32.h?

> Nope, it needs to go before <stdio.h> and friends, unfortunatly.

OK, patch committed as-is then. The whole thing still looks awfully
icky though, particularly the way pg_config_os.h is included in one
place for WIN32 and a different place everywhere else.

Would it make sense to split win32.h into two files, one that's included
in the normal pg_config_os.h place and one included after the system
includes?

regards, tom lane


From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] MSVC build broken (again)
Date: 2006-10-04 13:05:58
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA0FC1E@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> >> Would it be possible to move the whole <crtdefs.h> block
> into win32.h?
>
> > Nope, it needs to go before <stdio.h> and friends, unfortunatly.
>
> OK, patch committed as-is then. The whole thing still looks
> awfully icky though, particularly the way pg_config_os.h is
> included in one place for WIN32 and a different place everywhere else.
>
> Would it make sense to split win32.h into two files, one
> that's included in the normal pg_config_os.h place and one
> included after the system includes?

I've been looking at doing this before, but never got around to it. It's
a bit hairy, so it's definitly not something we want to do during beta,
though. But maybe for 8.3.

//Magnus