Reduce allocations when parsing times

Change-Id: Ife37d75fef81f5ecff14259f4567b2e16fcd97ab
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/time/time.h b/aos/time/time.h
index 52d763f..cd4ecda 100644
--- a/aos/time/time.h
+++ b/aos/time/time.h
@@ -26,8 +26,10 @@
 
   // Converts the time string to a time_point if it is well formatted.  This is
   // designed to reverse operator <<.
+#ifdef __linux__
   static std::optional<monotonic_clock::time_point> FromString(
       const std::string_view now);
+#endif
 
   // Returns the epoch (0).
   static constexpr monotonic_clock::time_point epoch() {
@@ -56,8 +58,10 @@
 
   // Converts the time string to a time_point if it is well formatted.  This is
   // designed to reverse operator <<.
+#ifdef __linux__
   static std::optional<realtime_clock::time_point> FromString(
       const std::string_view now);
+#endif
 
   // Returns the epoch (0).
   static constexpr realtime_clock::time_point epoch() {