WIN32 patches
This commit is contained in:
@@ -62,6 +62,40 @@ extern long timezone;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
|
||||
struct tm *localtime_r (const time_t *, struct tm *);
|
||||
struct tm *gmtime_r (const time_t *, struct tm *);
|
||||
|
||||
struct tm *
|
||||
localtime_r (const time_t *timer, struct tm *result)
|
||||
{
|
||||
struct tm *local_result;
|
||||
local_result = localtime (timer);
|
||||
|
||||
if (local_result == NULL || result == NULL)
|
||||
return NULL;
|
||||
|
||||
memcpy (result, local_result, sizeof (result));
|
||||
return result;
|
||||
}
|
||||
|
||||
struct tm *
|
||||
gmtime_r (const time_t *timer, struct tm *result)
|
||||
{
|
||||
struct tm *local_result;
|
||||
local_result = gmtime (timer);
|
||||
|
||||
if (local_result == NULL || result == NULL)
|
||||
return NULL;
|
||||
|
||||
memcpy (result, local_result, sizeof (result));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define TAI_UTC_OFFSET LL(4611686018427387914)
|
||||
|
||||
|
Reference in New Issue
Block a user