From: Stefan Weil <sw@weilnetz.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] win32: provide gmtime_r emulation
Date: Tue, 11 Sep 2012 19:15:11 +0200 [thread overview]
Message-ID: <504F719F.10707@weilnetz.de> (raw)
In-Reply-To: <1347348509-23900-1-git-send-email-pbonzini@redhat.com>
Am 11.09.2012 09:28, schrieb Paolo Bonzini:
> Windows has _s functions from C99 instead of _r functions from POSIX.
> Add an emulation shim.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> Not tested beyond compilation.
Hi Paolo,
latest MinGW-w64 supports _gmtime32_s, but MinGW does not,
so this solution won't link with MinGW.
With MinGW-w64, I get a compiler warning because
_gmtime32_s is not declared. The declaration is only enabled
when macro MINGW_HAS_SECURE_API is defined.
mingw-w64-crt/secapi/_gmtime32_s.cimplements _gmtime32_s
by first looking for that symbol in msvcrt.dll. Only some
newer versions of that Microsoft C Runtime library include
_gmtime32_s. Therefore the implementation includes a fallback
which uses the simple gmtime.
We should either use a wrapper based on gmtime (like the
MinGW-w64 fallback implementation).
Then a wrapper for localtime_r would also be reasonable.
I don't expect critical re-entrancy problems caused by
that pragmatic solution.
Or we use conditional compilation (#ifdef _WIN32) like it is currently
done for localtime_r in a small number of QEMU source files.
Regards,
Stefan
next prev parent reply other threads:[~2012-09-11 17:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 7:28 [Qemu-devel] [PATCH] win32: provide gmtime_r emulation Paolo Bonzini
2012-09-11 17:15 ` Stefan Weil [this message]
2012-09-11 17:57 ` Paolo Bonzini
2012-09-12 4:17 ` Stefan Weil
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=504F719F.10707@weilnetz.de \
--to=sw@weilnetz.de \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.