diff --git a/src/common/pico_util/datetime.c b/src/common/pico_util/datetime.c index ec17c1bd7..45d619ee3 100644 --- a/src/common/pico_util/datetime.c +++ b/src/common/pico_util/datetime.c @@ -1,16 +1,23 @@ #include "pico/util/datetime.h" -#include +#if !PICO_ON_DEVICE && __APPLE__ +// if we're compiling with LLVM on Apple, __weak does something else, but we don't care about overriding these ayway +#define __datetime_weak +#else +#define __datetime_weak __weak +#endif -struct tm * __weak pico_localtime_r(const time_t *time, struct tm *tm) { +__datetime_weak struct tm * pico_localtime_r(const time_t *time, struct tm *tm) { return localtime_r(time, tm); } -time_t __weak pico_mktime(struct tm *tm) { +__datetime_weak time_t pico_mktime(struct tm *tm) { return mktime(tm); } #if PICO_INCLUDE_RTC_DATETIME +#include + static const char *DATETIME_MONTHS[12] = { "January", "February",