Thread: Re: [PATCHES] MSVC build broken (again)

Re: [PATCHES] MSVC build broken (again)

From
Tom Lane
Date:
"Magnus Hagander" <mha@sollentuna.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

Re: [PATCHES] MSVC build broken (again)

From
"Magnus Hagander"
Date:
> > 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

Re: [PATCHES] MSVC build broken (again)

From
Tom Lane
Date:
"Magnus Hagander" <mha@sollentuna.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

Re: [PATCHES] MSVC build broken (again)

From
"Magnus Hagander"
Date:
> >> 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