mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-20 15:26:13 +08:00
should fix thread safe call on Mingw (thanks to @gator96100)
This commit is contained in:
parent
33d3027b70
commit
5b803d2dd4
|
@ -18,6 +18,10 @@
|
|||
|
||||
#define __STDC_FORMAT_MACROS
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#define _POSIX_C_SOURCE 200112L // need localtime_r()
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -128,7 +132,12 @@ static void print_time(uint64_t at) {
|
|||
|
||||
time_t t = at;
|
||||
struct tm lt;
|
||||
(void) localtime_r(&t, <);
|
||||
|
||||
#if defined(_WIN32)
|
||||
(void)localtime_s(<, &t);
|
||||
#else
|
||||
(void)localtime_r(&t, <);
|
||||
#endif
|
||||
|
||||
char res[32];
|
||||
strftime(res, sizeof(res), "%Y-%m-%d %H:%M:%S", <);
|
||||
|
|
Loading…
Reference in a new issue