Re: gettimeofday cause crash on Windows

Поиск
Список
Период
Сортировка
От Asif Naeem
Тема Re: gettimeofday cause crash on Windows
Дата
Msg-id CAEB4t-MUFTXhVPXCVWJr3ddeXM1GecFeTthSyCtTEAvvHie22g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: gettimeofday cause crash on Windows  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-bugs
Thank you Robert. I have built latest source code (master branch) with MSVC
2013, it seem working fine i.e.

Build succeeded.
>     0 Warning(s)
>     0 Error(s)


I will try to mimic currawong environment (MSVC 2008) to reproduce the
issue. Thanks.


On Sat, Feb 21, 2015 at 11:59 PM, Robert Haas <robertmhaas@gmail.com> wrote:

> On Sat, Feb 21, 2015 at 1:00 PM, Robert Haas <robertmhaas@gmail.com>
> wrote:
> > On Sat, Feb 21, 2015 at 12:20 PM, Robert Haas <robertmhaas@gmail.com>
> wrote:
> >> On Thu, Feb 12, 2015 at 9:59 PM, Michael Paquier
> >> <michael.paquier@gmail.com> wrote:
> >>> I looked at your patch and tested it with msvc and it looks good to me.
> >>
> >> Committed with cosmetic adjustments.  Hopefully one of you fine
> >> gentlemen will jump in to help if this turns out to break, because I
> >> don't do Windows.
> >
> > currawong doesn't like this:
> >
> > "c:\prog\bf\root\HEAD\pgsql.build\pgsql.sln" (default target) (1) ->
> > (postgres target) ->
> >   .\src\port\gettimeofday.c(53): error C2440: 'initializing' : cannot
> > convert from 'void (__cdecl *)(LPFILETIME)' to 'PgGetSystemTimeFn'
> >
> >
> > "c:\prog\bf\root\HEAD\pgsql.build\pgsql.sln" (default target) (1) ->
> > (misc\libpgport target) ->
> >   .\src\port\gettimeofday.c(53): error C2440: 'initializing' : cannot
> > convert from 'void (__cdecl *)(LPFILETIME)' to 'PgGetSystemTimeFn'
> >
> >     0 Warning(s)
> >     2 Error(s)
>
> I assume that the problem here must be whatever secret sauce WINAPI
> pours on the declaration.  PgSystemTimeFn is declared like this:
>
> typedef VOID (WINAPI *PgGetSystemTimeFn)(LPFILETIME);
>
> ...and the function we're trying to assign to a variable of that type
> is declared like this:
>
> static void init_gettimeofday(LPFILETIME lpSystemTimeAsFileTime);
>
> Either "void" does not mean the same thing as "VOID", which would be
> exceedingly evil, or the WINAPI in there matters, which is still evil,
> but somewhat more understandable.
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: gettimeofday cause crash on Windows
Следующее
От: Tom Lane
Дата:
Сообщение: Re: gettimeofday cause crash on Windows