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