qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] mingw32/64 fixes
Date: Thu, 5 Feb 2015 15:37:40 +0000	[thread overview]
Message-ID: <20150205153740.GH2385@redhat.com> (raw)
In-Reply-To: <1423149350-23961-1-git-send-email-quintela@redhat.com>

On Thu, Feb 05, 2015 at 04:15:50PM +0100, Juan Quintela wrote:
> Hi
> 
> In fedora 21 when crosscompiling for windows I get that this functions
> are already defined.  As they are declared there, I guess than in
> older complilers they weren't there.  Is there a portable way to get
> happy both old and new compilers?

[snip]

> diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
> index af3fbc4..7f39c42 100644
> --- a/include/sysemu/os-win32.h
> +++ b/include/sysemu/os-win32.h
> @@ -75,14 +75,6 @@
>  /* Declaration of ffs() is missing in MinGW's strings.h. */
>  int ffs(int i);
> 
> -/* Missing POSIX functions. Don't use MinGW-w64 macros. */
> -#undef gmtime_r
> -struct tm *gmtime_r(const time_t *timep, struct tm *result);
> -#undef localtime_r
> -struct tm *localtime_r(const time_t *timep, struct tm *result);
> -
> -char *strtok_r(char *str, const char *delim, char **saveptr);
> -
>  static inline void os_setup_signal_handling(void) {}
>  static inline void os_daemonize(void) {}
>  static inline void os_setup_post(void) {}

This is presumably due to the historic bad namespace pollution in Mingw64
winpthreads. They stuffed a bunch of macros in pthread.h for things
like gmtime_r, localtime_r and friends.  This was certainly true in the
mingw64 version that shipped with Fedora 20, but in Fedora 21 that bad
code in pthread.h has gone away. Presumably this change is what has
caused you trouble building.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

      reply	other threads:[~2015-02-05 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 15:15 [Qemu-devel] [RFC] mingw32/64 fixes Juan Quintela
2015-02-05 15:37 ` Daniel P. Berrange [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

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

  git send-email \
    --in-reply-to=20150205153740.GH2385@redhat.com \
    --to=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 NNTP newsgroup(s).