diff options
author | 2022-05-23 08:31:05 -0700 | |
---|---|---|
committer | 2022-05-23 08:31:54 -0700 | |
commit | 09eac4d507d010b533665f75673d17c07d3934c6 (patch) | |
tree | 706043da3e75bfb0a694e35b52ce7ca3a915372b /absl/time/internal/cctz/src/time_zone_lookup_test.cc | |
parent | 9e408e050ff3c1db12f9a58081b6af10e05561c4 (diff) |
Import of CCTZ from GitHub.
PiperOrigin-RevId: 450445030
Change-Id: I1c1e5ed67f81a181454f7fc6751bf42a3bc2bc48
Diffstat (limited to 'absl/time/internal/cctz/src/time_zone_lookup_test.cc')
-rw-r--r-- | absl/time/internal/cctz/src/time_zone_lookup_test.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/absl/time/internal/cctz/src/time_zone_lookup_test.cc b/absl/time/internal/cctz/src/time_zone_lookup_test.cc index 134d1430..27a53c5c 100644 --- a/absl/time/internal/cctz/src/time_zone_lookup_test.cc +++ b/absl/time/internal/cctz/src/time_zone_lookup_test.cc @@ -21,10 +21,14 @@ #include <thread> #include <vector> -#include "gtest/gtest.h" #include "absl/base/config.h" -#include "absl/time/internal/cctz/include/cctz/civil_time.h" #include "absl/time/internal/cctz/include/cctz/time_zone.h" +#if defined(__linux__) +#include <features.h> +#endif + +#include "gtest/gtest.h" +#include "absl/time/internal/cctz/include/cctz/civil_time.h" namespace chrono = std::chrono; @@ -1043,7 +1047,7 @@ TEST(MakeTime, LocalTimeLibC) { // 1) we know how to change the time zone used by localtime()/mktime(), // 2) cctz and localtime()/mktime() will use similar-enough tzdata, and // 3) we have some idea about how mktime() behaves during transitions. -#if defined(__linux__) && !defined(__ANDROID__) +#if defined(__linux__) && defined(__GLIBC__) && !defined(__ANDROID__) const char* const ep = getenv("TZ"); std::string tz_name = (ep != nullptr) ? ep : ""; for (const char* const* np = kTimeZoneNames; *np != nullptr; ++np) { |