kopia lustrzana https://github.com/Hamlib/Hamlib
Fix compilation of misc.c with gmtime_r replacement function for mingw
https://github.com/Hamlib/Hamlib/issues/784pull/788/head
rodzic
0e67bcd1fc
commit
d6350d1f0f
21
src/misc.c
21
src/misc.c
|
@ -2346,6 +2346,27 @@ uint32_t CRC32_function(uint8_t *buf, uint32_t len)
|
||||||
return crc ^ 0xFFFFFFFF;
|
return crc ^ 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
// gmtime_r can be defined by mingw
|
||||||
|
#ifndef gmtime_r
|
||||||
|
static struct tm *gmtime_r(const time_t *t, struct tm *r)
|
||||||
|
{
|
||||||
|
// gmtime is threadsafe in windows because it uses TLS
|
||||||
|
struct tm *theTm = gmtime(t);
|
||||||
|
|
||||||
|
if (theTm)
|
||||||
|
{
|
||||||
|
*r = *theTm;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // gmtime_r
|
||||||
|
#endif // _WIN32
|
||||||
|
|
||||||
//! @cond Doxygen_Suppress
|
//! @cond Doxygen_Suppress
|
||||||
char *date_strget(char *buf, int buflen)
|
char *date_strget(char *buf, int buflen)
|
||||||
{
|
{
|
||||||
|
|
Ładowanie…
Reference in New Issue