[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross-compiling with mingw

From: Neil Jerram
Subject: Re: Cross-compiling with mingw
Date: Sun, 21 Jun 2009 17:34:44 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Next MinGW build issue:

Sylvain Beucler <address@hidden> writes:

> $ make
> [...]
> DLL_EXPORT -DPIC -o .libs/libguile_la-stime.o
> cc1: warnings being treated as errors
> stime.c:85: warning: ‘tzname’ redeclared without dllimport attribute: 
> previous dllimport ignored
> I found 2 references to this issue:
> - http://cygwin.com/ml/cygwin/2008-01/msg00491.html
> => removed tzname
> - http://www.nabble.com/getdate-on-mingw:-tzname-problems-td14855896.html
> => use HAVE_DECL_TZNAME instead
> I used the 2nd option:
> # if !HAVE_DECL_TZNAME /* For SGI.  */
> extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
> #endif
> #if defined (__MINGW32__)
> # define tzname _tzname
> #endif

I don't understand this.  The second half of this section implies that
the MinGW build isn't going to reference a function called `tzname'
anyway (because it's going to use `_tzname' instead).  So why should a
MinGW build want any declaration of `tzname' at all?

And as far as a declaration of `_tzname' is concerned, there are no
more #includes after this, so we must have already got a declaration
of `_tzname' from one of the preceding includes.

Hence, and taking care not to alter the !__MINGW32__ behaviour:

#if defined (__MINGW32__)
# define tzname _tzname
#ifndef tzname /* For SGI.  */
extern char *tzname[]; /* RS6000 and others reject char **tzname.  */

This looks pretty clear and safe to me, so I'll push a commit
straightaway and see if it works in the overnight MinGW build.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]