Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Add compat file for dynamically loading the functions that MinGW

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Hiroshi Saito <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>
Cc: Magnus Hagander <mha(at)postgresql(dot)org>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add compat file for dynamically loading the functions that MinGW
Date: 2007-10-31 06:43:27
Message-ID: 4728240F.1030106@hagander.net (view raw or flat)
Thread:
Lists: pgsql-committers
Hiroshi Saito wrote:
> Hi Magnus.
> 
> Ooops, error happen by MinGW (gcc)....CVS-HEAD
> 
> $ make -s
> signal.c: In function `pg_signal_thread':
> signal.c:254: warning: unsigned int format, DWORD arg (arg 4)
> mingwcompat.c:48: error: syntax error before "WAITORTIMERCALLBACK"
> mingwcompat.c:54: error: syntax error before "WAITORTIMERCALLBACK"
> mingwcompat.c:58: warning: no previous prototype for
> 'RegisterWaitForSingleObject'
> mingwcompat.c: In function `RegisterWaitForSingleObject':
> mingwcompat.c:73: error: `phNewWaitObject' undeclared (first use in this
> function)
> mingwcompat.c:73: error: (Each undeclared identifier is reported only once
> mingwcompat.c:73: error: for each function it appears in.)
> mingwcompat.c:73: error: `hObject' undeclared (first use in this function)
> mingwcompat.c:73: error: `Callback' undeclared (first use in this function)
> mingwcompat.c:73: error: `Context' undeclared (first use in this function)
> mingwcompat.c:73: error: `dwMilliseconds' undeclared (first use in this
> function)
> mingwcompat.c:73: error: `dwFlags' undeclared (first use in this function)
> make[4]: *** [mingwcompat.o] Error 1
> make[3]: *** [win32.dir] Error 2
> make[2]: *** [port-recursive] Error 2
> make[1]: *** [all] Error 2
> make: *** [all] Error 2
> 
> /END
> However, this patch is good.
> 
> *** src/backend/port/win32/mingwcompat.c.orig   Wed Oct 31 14:28:51 2007
> --- src/backend/port/win32/mingwcompat.c        Wed Oct 31 14:55:43 2007
> ***************
> *** 20,25 ****
> --- 20,27 ----
>   */
>  #ifndef WIN32_ONLY_COMPILER
> 
> + typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK;
> +
>  static HMODULE kernel32 = NULL;
> 
>  /*
> 
> Furthermore, .....
> 
> make[3]: Entering directory `/home/hiroshi/pgsql/src/backend/postmaster'
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
> -I../../../src/include -I./src/include/port/win32 -DEXEC_BACKEND
> "-I../../../src/include/port/win32" -DBUILDING_DLL  -c -o postmaster.o
> postmaster.c
> postmaster.c: In function `internal_forkexec':
> postmaster.c:3466: warning: implicit declaration of function
> `RegisterWaitForSingleObject'
> postmaster.c:3471: error: `WT_EXECUTEONLYONCE' undeclared (first use in
> this function)
> postmaster.c:3471: error: (Each undeclared identifier is reported only once
> postmaster.c:3471: error: for each function it appears in.)
> postmaster.c:3471: error: `WT_EXECUTEINWAITTHREAD' undeclared (first use
> in this function)
> postmaster.c: In function `pgwin32_deadchild_callback':
> postmaster.c:4520: warning: implicit declaration of function
> `UnregisterWaitEx'
> make[3]: *** [postmaster.o] Error 1
> make[3]: Leaving directory `/home/hiroshi/pgsql/src/backend/postmaster'
> make[2]: *** [postmaster-recursive] Error 2
> make[2]: Leaving directory `/home/hiroshi/pgsql/src/backend'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/home/hiroshi/pgsql/src'
> make: *** [all] Error 2
> /END
> 
> Umm, define _WIN32_WINNT 0x0500(c.h) is ignore?_?
> 
> Regards,
> Hiroshi Saito

Grumble. This works perfectly fine on all three mingw installs I've
tested, as well as on all the buildfarm members.

What version of mingw is this? Are you by any chance on a *really* old one?

Do those defines exist in the mingw include files on this one?

//Magnus

In response to

Responses

pgsql-committers by date

Next:From: Hiroshi SaitoDate: 2007-10-31 06:52:06
Subject: Re: pgsql: Add compat file for dynamically loading the functions that MinGW
Previous:From: Hiroshi SaitoDate: 2007-10-31 05:58:46
Subject: Re: pgsql: Add compat file for dynamically loading the functions that MinGW

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group