WIN32 patches

This commit is contained in:
U-WIN-ENP104VVO3U\Vítor Santos Costa
2011-03-21 17:07:58 +00:00
parent 417bbd6d46
commit 7670ce631b
18 changed files with 2296 additions and 2175 deletions

View File

@@ -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)