qemu-e2k/include/qemu
Daniel P. Berrange 4d9310f427 oslib-win32: only provide localtime_r/gmtime_r if missing
The oslib-win32 file currently provides a localtime_r and
gmtime_r replacement unconditionally. Some versions of
Mingw-w64 would provide crude macros for localtime_r/gmtime_r
which QEMU takes care to disable. Latest versions of Mingw-w64
now provide actual functions for localtime_r/gmtime_r, but
with a twist that you have to include unistd.h or pthread.h
before including time.h.  By luck some files in QEMU have
such an include order, resulting in compile errors:

  CC    util/osdep.o
In file included from include/qemu-common.h:48:0,
                 from util/osdep.c:48:
include/sysemu/os-win32.h:77:12: error: redundant redeclaration of 'gmtime_r' [-Werror=redundant-decls]
 struct tm *gmtime_r(const time_t *timep, struct tm *result);
            ^
In file included from include/qemu-common.h:35:0,
                 from util/osdep.c:48:
/usr/i686-w64-mingw32/sys-root/mingw/include/time.h:272:107: note: previous definition of 'gmtime_r' was here
In file included from include/qemu-common.h:48:0,
                 from util/osdep.c:48:
include/sysemu/os-win32.h:79:12: error: redundant redeclaration of 'localtime_r' [-Werror=redundant-decls]
 struct tm *localtime_r(const time_t *timep, struct tm *result);
            ^
In file included from include/qemu-common.h:35:0,
                 from util/osdep.c:48:
/usr/i686-w64-mingw32/sys-root/mingw/include/time.h:269:107: note: previous definition of 'localtime_r' was here

This change adds a configure test to see if localtime_r
exits, and only enables the QEMU impl if missing. We also
re-arrange qemu-common.h try attempt to guarantee that all
source files get unistd.h before time.h and thus see the
localtime_r/gmtime_r defs.

[sw: Use "official" spellings for Mingw-w64, MinGW in comments.]
[sw: Terminate sentences with a dot in comments.]

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-09-24 21:13:49 +02:00
..
acl.h
atomic.h atomics: add explicit compiler fence in __atomic memory barriers 2015-06-05 19:45:13 +02:00
bitmap.h bitmap: add atomic test and clear 2015-06-05 17:10:00 +02:00
bitops.h bitmap: add atomic set functions 2015-06-05 17:10:00 +02:00
bswap.h
compatfd.h util: Remove unused functions 2015-04-30 16:05:48 +03:00
compiler.h compiler.h: Use glue() in QEMU_BUILD_BUG_ON define 2015-08-19 16:29:53 +01:00
config-file.h
crc32c.h
envlist.h
error-report.h
event_notifier.h
fifo8.h
fprintf-fn.h Stop including qemu-common.h in memory.h 2015-07-06 14:59:09 +02:00
hbitmap.h util/hbitmap: Add an API to reset all set bits in hbitmap 2015-06-23 15:06:16 +01:00
host-utils.h host-utils: Add revbit functions 2015-09-15 07:45:33 -07:00
int128.h
iov.h iov: don't touch iov in iov_send_recv() 2015-06-23 16:05:34 +01:00
log.h disas: Remove uses of CPU env 2015-06-22 17:40:01 +02:00
main-loop.h iohandler: Use aio API 2015-09-07 18:14:03 +02:00
module.h
notify.h
option_int.h
option.h QemuOpts: Wean off qerror_report_err() 2015-06-22 18:20:39 +02:00
osdep.h oslib-win32: only provide localtime_r/gmtime_r if missing 2015-09-24 21:13:49 +02:00
queue.h queue.h: Add QLIST_FIX_HEAD_PTR() 2015-06-12 17:04:59 +02:00
range.h
ratelimit.h
rcu_queue.h
rcu.h rcu: fix comment with s/rcu_gp_lock/rcu_registry_lock/ 2015-09-09 15:34:54 +02:00
readline.h
rfifolock.h
seqlock.h seqlock: read sequence number atomically 2015-09-07 18:12:39 +02:00
sockets.h Include qapi/qmp/qerror.h exactly where needed 2015-06-22 18:20:41 +02:00
thread-posix.h
thread-win32.h qemu-thread: add a fast path to the Win32 QemuEvent 2015-09-24 20:52:28 +02:00
thread.h
throttle.h throttle: refuse bps_max/iops_max without bps/iops 2015-08-05 12:53:48 +01:00
timer.h qemu-common.h: Move muldiv64() to host-utils.h 2015-08-19 16:29:53 +01:00
typedefs.h machine: Eliminate QEMUMachine and qemu_register_machine() 2015-09-19 16:40:30 +02:00
uri.h
xattr.h