Обсуждение: Re: [PATCHES] Adminpack build fix

Поиск
Список
Период
Сортировка

Re: [PATCHES] Adminpack build fix

От
Tom Lane
Дата:
"Magnus Hagander" <mha@sollentuna.net> writes:
> Attached patch removes a couple of extern definitions from adminpack,
> replacing some of them with a #include. (Cam eup with this because we
> got a duplicate definition of DataDir when building with Visual C++).

That isn't going to work unless we put DLLIMPORT into the main headers.
The reason for redeclaring these in the contrib files is to get
DLLIMPORT onto them...

            regards, tom lane

Re: [PATCHES] Adminpack build fix

От
"Magnus Hagander"
Дата:
> > Attached patch removes a couple of extern definitions from
> adminpack,
> > replacing some of them with a #include. (Cam eup with this
> because we
> > got a duplicate definition of DataDir when building with
> Visual C++).
>
> That isn't going to work unless we put DLLIMPORT into the
> main headers.
> The reason for redeclaring these in the contrib files is to
> get DLLIMPORT onto them...

Interedting - it builds on MSVC without it :-O

Anyway. That certainly explains why MSVC is complaining - it's getting
completely different definitions of these variables from the header and
from the actual file.

What do you think about simply adding DLLIMPORT to the variables in the
main header?

//Magnus

Re: [PATCHES] Adminpack build fix

От
Tom Lane
Дата:
"Magnus Hagander" <mha@sollentuna.net> writes:
>> The reason for redeclaring these in the contrib files is to
>> get DLLIMPORT onto them...

> Interedting - it builds on MSVC without it :-O

> Anyway. That certainly explains why MSVC is complaining - it's getting
> completely different definitions of these variables from the header and
> from the actual file.

The same redeclaration technique is being used elsewhere (pg_buffercache
and pg_freespacemap it looks like).  Aren't you getting warnings there
too?

            regards, tom lane

Re: [PATCHES] Adminpack build fix

От
"Magnus Hagander"
Дата:
> >> The reason for redeclaring these in the contrib files is to get
> >> DLLIMPORT onto them...
>
> > Interedting - it builds on MSVC without it :-O
>
> > Anyway. That certainly explains why MSVC is complaining -
> it's getting
> > completely different definitions of these variables from the header
> > and from the actual file.
>
> The same redeclaration technique is being used elsewhere
> (pg_buffercache and pg_freespacemap it looks like).  Aren't
> you getting warnings there too?

I am - I just started working on getting those done as well. (they were
also living on my list of fix-later ones for some other reasons - the
other reasons now having been fixed)

//Magnus

Re: [PATCHES] Adminpack build fix

От
Tom Lane
Дата:
"Magnus Hagander" <mha@sollentuna.net> writes:
>> The same redeclaration technique is being used elsewhere
>> (pg_buffercache and pg_freespacemap it looks like).  Aren't
>> you getting warnings there too?

> I am - I just started working on getting those done as well.

OK, I guess we gotta play them all honestly.  Will fix.

            regards, tom lane