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