diff --git a/ChangeLog b/ChangeLog index bf45597e874..359fdcd6723 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10259,4 +10259,5 @@ https://github.com/kaushalparikh/nuttx (2015-04-19). * drivers/usbhost/usbhost_enumerate.c: Last of USB hub logic from https://github.com/kaushalparikh/nuttx (2015-04-19). - + * include/time.h: Add prototypes for localtime() and localtimer_r() + (2015-04-21). diff --git a/include/time.h b/include/time.h index 88f4606d5c3..904022a7669 100644 --- a/include/time.h +++ b/include/time.h @@ -96,8 +96,8 @@ #ifndef CONFIG_LIBC_LOCALTIME /* Local time is the same as gmtime in this implementation */ -#define localtime(c) gmtime(c) -#define localtime_r(c,r) gmtime_r(c,r) +# define localtime(c) gmtime(c) +# define localtime_r(c,r) gmtime_r(c,r) #endif /******************************************************************************** @@ -196,6 +196,10 @@ int clock_getres(clockid_t clockid, FAR struct timespec *res); time_t mktime(FAR struct tm *tp); FAR struct tm *gmtime(FAR const time_t *timer); FAR struct tm *gmtime_r(FAR const time_t *timer, FAR struct tm *result); +#ifdef CONFIG_LIBC_LOCALTIME +FAR struct tm *localtime(FAR const time_t *timer); +FAR struct tm *localtime_r(FAR const time_t *timer, FAR struct tm *result); +#endif size_t strftime(FAR char *s, size_t max, FAR const char *format, FAR const struct tm *tm);