src/dfxml.c: fix xml_add_DFXML_creator() for mingw32

This commit is contained in:
Christophe Grenier 2020-08-24 18:59:05 +02:00
parent 2846258670
commit 73d49dbde9

View file

@ -250,8 +250,12 @@ void xml_add_DFXML_creator(const char *package, const char *version)
{
char outstr[200];
const time_t t = time(NULL);
#if defined(__MINGW32__) || defined(__FRAMAC__)
const struct tm *tmptr = localtime(&t);
#else
struct tm tm_tmp;
const struct tm *tmp = localtime_r(&t,&tm_tmp);
#endif
if (tmp != NULL &&
strftime(outstr, sizeof(outstr), "%Y-%m-%dT%H:%M:%S%z", tmp) != 0)
{