support MINGW

This commit is contained in:
unknown 2011-03-21 23:39:25 +00:00
parent 7670ce631b
commit 185151db2a

22
packages/PLStream/pl-tai.c Executable file → Normal file
View File

@ -67,8 +67,8 @@ extern long timezone;
#include <time.h> #include <time.h>
#include <string.h> #include <string.h>
#ifndef localtime_r
struct tm *localtime_r (const time_t *, struct tm *); struct tm *localtime_r (const time_t *, struct tm *);
struct tm *gmtime_r (const time_t *, struct tm *);
struct tm * struct tm *
localtime_r (const time_t *timer, struct tm *result) localtime_r (const time_t *timer, struct tm *result)
@ -82,19 +82,15 @@ localtime_r (const time_t *timer, struct tm *result)
memcpy (result, local_result, sizeof (result)); memcpy (result, local_result, sizeof (result));
return result; return result;
} }
#endif
struct tm * #ifndef asctime_r
gmtime_r (const time_t *timer, struct tm *result) #define asctime_r(_Tm, _Buf) ({ char *___tmp_tm = asctime((_Tm)); \
{ if (___tmp_tm) \
struct tm *local_result; ___tmp_tm = \
local_result = gmtime (timer); strcpy((_Buf),___tmp_tm);\
___tmp_tm; })
if (local_result == NULL || result == NULL) #endif
return NULL;
memcpy (result, local_result, sizeof (result));
return result;
}
#endif #endif
#define TAI_UTC_OFFSET LL(4611686018427387914) #define TAI_UTC_OFFSET LL(4611686018427387914)