Windows: Build and export localtime_r

This commit is contained in:
Asanka C. Herath
2010-11-09 15:50:50 -05:00
parent 0f853405fe
commit e4a2e9cfe0
2 changed files with 7 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ libroken_la_OBJS = \
$(OBJ)\hostent_find_fqdn.obj \
$(OBJ)\inet_aton.obj \
$(OBJ)\issuid.obj \
$(OBJ)\localtime_r.obj \
$(OBJ)\lstat.obj \
$(OBJ)\mini_inetd.obj \
$(OBJ)\mkstemp.obj \

View File

@@ -42,6 +42,11 @@
ROKEN_LIB_FUNCTION struct tm * ROKEN_LIB_CALL
localtime_r(const time_t *timer, struct tm *result)
{
#ifdef _MSC_VER
return (localtime_s(result, timer) == 0)? result : NULL;
#else
struct tm *tm;
tm = localtime((time_t *)timer);
@@ -49,6 +54,7 @@ localtime_r(const time_t *timer, struct tm *result)
return NULL;
*result = *tm;
return result;
#endif
}
#endif