@@ -2386,37 +2386,6 @@ if test "$vhost_net" = ""; then
test "$vhost_kernel" = "yes" && vhost_net=yes
fi
-##########################################
-# MinGW / Mingw-w64 localtime_r/gmtime_r check
-
-if test "$mingw32" = "yes"; then
- # Some versions of MinGW / Mingw-w64 lack localtime_r
- # and gmtime_r entirely.
- #
- # Some versions of Mingw-w64 define a macro for
- # localtime_r/gmtime_r.
- #
- # Some versions of Mingw-w64 will define functions
- # for localtime_r/gmtime_r, but only if you have
- # _POSIX_THREAD_SAFE_FUNCTIONS defined. For fun
- # though, unistd.h and pthread.h both define
- # that for you.
- #
- # So this #undef localtime_r and #include <unistd.h>
- # are not in fact redundant.
-cat > $TMPC << EOF
-#include <unistd.h>
-#include <time.h>
-#undef localtime_r
-int main(void) { localtime_r(NULL, NULL); return 0; }
-EOF
- if compile_prog "" "" ; then
- localtime_r="yes"
- else
- localtime_r="no"
- fi
-fi
-
##########################################
# pkg-config probe
@@ -6610,9 +6579,6 @@ if [ "$bsd" = "yes" ] ; then
echo "CONFIG_BSD=y" >> $config_host_mak
fi
-if test "$localtime_r" = "yes" ; then
- echo "CONFIG_LOCALTIME_R=y" >> $config_host_mak
-fi
if test "$qom_cast_debug" = "yes" ; then
echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
fi
@@ -48,12 +48,12 @@
#define siglongjmp(env, val) longjmp(env, val)
/* Missing POSIX functions. Don't use MinGW-w64 macros. */
-#ifndef CONFIG_LOCALTIME_R
+#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
#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);
-#endif /* CONFIG_LOCALTIME_R */
+#endif /* _POSIX_THREAD_SAFE_FUNCTIONS */
static inline void os_setup_signal_handling(void) {}
static inline void os_daemonize(void) {}
@@ -106,7 +106,7 @@ void qemu_anon_ram_free(void *ptr, size_t size)
}
}
-#ifndef CONFIG_LOCALTIME_R
+#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
/* FIXME: add proper locking */
struct tm *gmtime_r(const time_t *timep, struct tm *result)
{
@@ -130,7 +130,7 @@ struct tm *localtime_r(const time_t *timep, struct tm *result)
}
return p;
}
-#endif /* CONFIG_LOCALTIME_R */
+#endif /* _POSIX_THREAD_SAFE_FUNCTIONS */
static int socket_error(void)
{