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

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

From: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>
To: "Magnus Hagander" <mha(at)postgresql(dot)org>
Cc: <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add compat file for dynamically loading the functions that MinGW
Date: 2007-10-31 05:58:46
Message-ID: 0bfc01c81b83$19fb3b60$c601a8c0@HP22720319231 (view raw or flat)
Thread:
Lists: pgsql-committers
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

From: "Magnus Hagander" <mha(at)postgresql(dot)org>

> Log Message:
> -----------
> Add compat file for dynamically loading the functions that MinGW is missing
> the imports for. Add RegisterWaitForSingleObject() to the list of such
> functions, which should take care of the current buildfarm breakage.
>
> Modified Files:
> --------------
>    pgsql/src/backend/port/win32:
>        Makefile (r1.10 -> r1.11)
> 
> (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/port/win32/Makefile?r1=1.10&r2=1.11)
>
> Added Files:
> -----------
>    pgsql/src/backend/port/win32:
>        mingwcompat.c (r1.1)
> 
> (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/port/win32/mingwcompat.c?rev=1.1&content-type=text/x-cvsweb-markup)
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>               http://archives.postgresql.org 


In response to

Responses

pgsql-committers by date

Next:From: Magnus HaganderDate: 2007-10-31 06:43:27
Subject: Re: pgsql: Add compat file for dynamically loading the functions that MinGW
Previous:From: Alvaro HerreraDate: 2007-10-30 23:44:07
Subject: Re: Re: [COMMITTERS] pgsql: simple script to pulltogether a very small (<500k) tar file

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