tzdb.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html
  10. #ifndef _LIBCPP___CHRONO_TZDB_H
  11. #define _LIBCPP___CHRONO_TZDB_H
  12. #include <version>
  13. // Enable the contents of the header only when libc++ was built with experimental features enabled.
  14. #if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
  15. # include <__chrono/time_zone.h>
  16. # include <__chrono/time_zone_link.h>
  17. # include <__config>
  18. # include <string>
  19. # include <vector>
  20. # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  21. # pragma GCC system_header
  22. # endif
  23. _LIBCPP_PUSH_MACROS
  24. # include <__undef_macros>
  25. _LIBCPP_BEGIN_NAMESPACE_STD
  26. # if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
  27. !defined(_LIBCPP_HAS_NO_LOCALIZATION)
  28. namespace chrono {
  29. struct tzdb {
  30. string version;
  31. vector<time_zone> zones;
  32. vector<time_zone_link> links;
  33. };
  34. } // namespace chrono
  35. # endif // _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM)
  36. // && !defined(_LIBCPP_HAS_NO_LOCALIZATION)
  37. _LIBCPP_END_NAMESPACE_STD
  38. _LIBCPP_POP_MACROS
  39. #endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
  40. #endif // _LIBCPP___CHRONO_TZDB_H