From: SeokYeon Hwang Date: Mon, 16 Nov 2015 05:40:42 +0000 (+0900) Subject: oslib-win32: use localtime_r/gmtime_r that is provided by MinGW X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~163 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99949eced2426249eae33725e26e323c91a9e906;p=sdk%2Femulator%2Fqemu.git oslib-win32: use localtime_r/gmtime_r that is provided by MinGW Recent MinGW-w64 contains their own localtime_r() and gmtime_r(). But it is only enabled under specific including order. This issue is resolved by 4d9310f427b477a126f6f2006c3a73b9764948b6 in upstream. But it is dependent on other commits that contain complex modifications. So now, we choose simple solution for it - just re-arrange header including order. Change-Id: Ie1a8d46baa9a5e8f1140362faa81567b1ba257a5 Signed-off-by: SeokYeon Hwang --- diff --git a/include/qemu-common.h b/include/qemu-common.h index fb3da6ca22..e4345f9cfc 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -32,10 +32,13 @@ #include #include #include +// CONFIG_MARU MODIFICATION +// recent MinGW-w64 provides gmtime_r(), localtime_r(). we use them. +// for that, unistd.h should be included before time.h +#include #include #include #include -#include #include #include #include diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index de356e3006..795da47ecf 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -72,18 +72,14 @@ #define sigsetjmp(env, savemask) setjmp(env) #define siglongjmp(env, val) longjmp(env, val) -/* Missing POSIX functions. Don't use MinGW-w64 macros. */ // CONFIG_MARU MODIFICATION -#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wredundant-decls" -#endif +// recent MinGW-w64 provides gmtime_r(), localtime_r(). we use them. +#if 0 +/* 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); -#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE -#pragma GCC diagnostic pop #endif diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 23d934a6c0..217f28a201 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -110,6 +110,9 @@ void qemu_anon_ram_free(void *ptr, size_t size) } } +// CONFIG_MARU MODIFICATION +// recent MinGW-w64 provides gmtime_r(), localtime_r(). we use them. +#if 0 /* FIXME: add proper locking */ struct tm *gmtime_r(const time_t *timep, struct tm *result) { @@ -133,6 +136,7 @@ struct tm *localtime_r(const time_t *timep, struct tm *result) } return p; } +#endif void qemu_set_block(int fd) {