qemu-patch-raspberry4/include
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
..
block block: Allow specifying driver-specific options to reopen 2015-09-14 16:51:36 +02:00
crypto crypto: introduce new module for handling TLS sessions 2015-09-15 15:07:43 +01:00
disas disas: Add print_insn to disassemble info 2015-07-09 15:20:40 +02:00
exec include/exec: Move cputlb exec.c defs out 2015-09-16 17:33:33 +02:00
fpu softfloat: expand out STATUS macro 2015-02-06 16:11:38 +00:00
hw hw/arm/virt: Add gic-version option to virt machine 2015-09-24 01:29:37 +01:00
libdecnumber Fix new typos in comments (found by codespell) 2014-07-18 17:45:36 +04:00
migration migration: Fix global state with Xen. 2015-08-03 16:13:23 +00:00
monitor qom: Don't use 'gen': false for qom-get, qom-set, object-add 2015-09-21 09:56:49 +02:00
net qmp: Wean off qerror_report() 2015-06-22 18:20:40 +02:00
qapi qapi: Introduce a first class 'any' type 2015-09-21 09:56:49 +02:00
qemu oslib-win32: only provide localtime_r/gmtime_r if missing 2015-09-24 21:13:49 +02:00
qom cpu: Add crash_occurred flag into CPUState 2015-09-16 17:33:32 +02:00
standard-headers target-i386: move asm-x86/hyperv.h to standard-headers 2015-09-16 17:33:32 +02:00
sysemu oslib-win32: only provide localtime_r/gmtime_r if missing 2015-09-24 21:13:49 +02:00
ui gtk: avoid redefining _WIN32_WINNT macro 2015-09-24 20:52:28 +02:00
config.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
elf.h linux-user: Support tilegx architecture in linux-user 2015-09-15 07:41:19 -07:00
glib-compat.h glib: remove stale compat functions 2015-05-22 15:58:06 -04:00
qemu-common.h * Support for jemalloc 2015-09-14 16:13:16 +01:00
qemu-io.h qemu-io: Use BlockBackend 2015-02-16 15:07:19 +00:00
qjson.h QJSON: Add JSON writer 2015-02-05 17:16:14 +01:00
trace-tcg.h trace: [tcg] Generate TCG tracing routines 2014-08-12 14:26:12 +01:00
trace.h trace: [tcg] Include event definitions in "trace.h" 2014-08-12 14:26:12 +01:00