unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
To: bug-guile@gnu.org
Cc: Sylvain Beucler <beuc@beuc.net>
Subject: Re: Cross-compiling with mingw
Date: Sun, 21 Jun 2009 17:34:44 +0100	[thread overview]
Message-ID: <87ocshpmu3.fsf@arudy.ossau.uklinux.net> (raw)
In-Reply-To: <20080526204344.GA14261@perso.beuc.net> (Sylvain Beucler's message of "Mon\, 26 May 2008 22\:43\:44 +0200")

Next MinGW build issue:

Sylvain Beucler <beuc@beuc.net> 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
#else
#ifndef tzname /* For SGI.  */
extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
#endif
#endif

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.

Regards,
        Neil




      parent reply	other threads:[~2009-06-21 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-26 20:43 Cross-compiling with mingw Sylvain Beucler
2008-05-28 21:00 ` Sylvain Beucler
2009-06-25 20:47   ` Neil Jerram
2009-06-21 16:34 ` Neil Jerram [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ocshpmu3.fsf@arudy.ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    --cc=beuc@beuc.net \
    --cc=bug-guile@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).