Index: src/base/platform/platform-solaris.cc |
diff --git a/src/base/platform/platform-solaris.cc b/src/base/platform/platform-solaris.cc |
index 6783c6ba8922977e225581f0ce8d633f5601736c..d5cc658d73aab1de12325c72692a8c13534e42ed 100644 |
--- a/src/base/platform/platform-solaris.cc |
+++ b/src/base/platform/platform-solaris.cc |
@@ -28,14 +28,21 @@ |
#undef MAP_TYPE |
#include "src/base/macros.h" |
+#include "src/base/platform/platform-posix.h" |
#include "src/base/platform/platform.h" |
- |
namespace v8 { |
namespace base { |
+class SolarisTimezoneCache : public PosixTimezoneCache { |
+ const char* LocalTimezone(double time) override; |
+ |
+ double LocalTimeOffset() override; |
-const char* OS::LocalTimezone(double time, TimezoneCache* cache) { |
+ ~SolarisTimezoneCache() override {} |
+}; |
+ |
+const char* SolarisTimezoneCache::LocalTimezone(double time) { |
if (std::isnan(time)) return ""; |
time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); |
struct tm tm; |
@@ -44,12 +51,12 @@ const char* OS::LocalTimezone(double time, TimezoneCache* cache) { |
return tzname[0]; // The location of the timezone string on Solaris. |
} |
- |
-double OS::LocalTimeOffset(TimezoneCache* cache) { |
+double SolarisTimezoneCache::LocalTimeOffset() { |
tzset(); |
return -static_cast<double>(timezone * msPerSecond); |
} |
+TimezoneCache* OS::CreateTimezoneCache() { return new SolarisTimezoneCache(); } |
void* OS::Allocate(const size_t requested, |
size_t* allocated, |