Re: Suppress warnings on mingw

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Suppress warnings on mingw
Date: 2007-04-18 08:32:51
Message-ID: 20070418083251.GD20431@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Mon, Apr 16, 2007 at 12:32:56PM +0900, ITAGAKI Takahiro wrote:
> This trivial patch fixes the following warnings on mingw.
>
> ----
> pthread-win32.c:20: warning: no previous prototype for 'pthread_self'

> Index: src/bin/pgevent/pgevent.def
> ===================================================================
> --- src/bin/pgevent/pgevent.def (HEAD)
> +++ src/bin/pgevent/pgevent.def (working copy)
> @@ -1,4 +1,4 @@
> ; dlltool --output-def pgevent.def pgevent.o pgmsgevent.o
> EXPORTS
> - DllUnregisterServer ;
> - DllRegisterServer ;
> + DllUnregisterServer = DllUnregisterServer(at)0 ;
> + DllRegisterServer = DllRegisterServer(at)0 ;

This breaks the MSVC build, so not applied. Are you sure we should not just
follow the instructions given in the error msg?

pgevent.exp : error LNK2001: unresolved external symbol DllRegisterServer(at)0
.\Debug\pgevent\pgevent.dll : fatal error LNK1120: 1 unresolved externals

> Index: src/port/pthread-win32.h
> ===================================================================
> --- src/port/pthread-win32.h (HEAD)
> +++ src/port/pthread-win32.h (working copy)
> @@ -5,7 +5,7 @@
> typedef HANDLE pthread_mutex_t;
> typedef int pthread_once_t;
>
> -DWORD pthread_self();
> +DWORD pthread_self(void);
>
> void pthread_setspecific(pthread_key_t, void *);
> void *pthread_getspecific(pthread_key_t);
>
I've applied the fix for this. I also updated the C file, since with your
patch the C and the H file had different things. If there was a reason you
didn't update the C file, let me know and I'll revert that part.

//Magnus

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message ITAGAKI Takahiro 2007-04-18 08:46:00 Re: Suppress warnings on mingw
Previous Message Simon Riggs 2007-04-18 07:14:42 Re: log_autovacuum