From 51b6cfb3b034d52f0565c7a15ddb94959ad0f4fc Mon Sep 17 00:00:00 2001 From: Robert Heller Date: Sat, 21 Nov 2020 06:29:29 -0500 Subject: [PATCH] Protect unimplemented POSIX calls in BroadcastTime::clear_timezone() to allow OpenMRNLite to compile on Arduino flavored platforms. (#464) setenv() and tset() not available in the Arduino ESP32 platform. This fix takes those calls out. I don't know what (if anything) could replace them, but making BroadcastTime::clear_timezone() seems like a harmless short term solution. === * Protect unimplemented POSIX calls in BroadcastTime::clear_timezone() to allow OpenMRNLite to compile on Arduino flavored platforms. * Protect unimplemented POSIX calls in BroadcastTime::clear_timezone() to allow OpenMRNLite to compile on arduino-esp32. --- src/openlcb/BroadcastTime.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openlcb/BroadcastTime.cxx b/src/openlcb/BroadcastTime.cxx index fb5a91be0..0e2a8630a 100644 --- a/src/openlcb/BroadcastTime.cxx +++ b/src/openlcb/BroadcastTime.cxx @@ -46,8 +46,10 @@ namespace openlcb // void BroadcastTime::clear_timezone() { +#ifndef ESP32 setenv("TZ", "GMT0", 1); tzset(); +#endif } } // namespace openlcb