zone_info_source.cc
Go to the documentation of this file.
00001 // Copyright 2016 Google Inc. All Rights Reserved.
00002 //
00003 // Licensed under the Apache License, Version 2.0 (the "License");
00004 // you may not use this file except in compliance with the License.
00005 // You may obtain a copy of the License at
00006 //
00007 //   https://www.apache.org/licenses/LICENSE-2.0
00008 //
00009 //   Unless required by applicable law or agreed to in writing, software
00010 //   distributed under the License is distributed on an "AS IS" BASIS,
00011 //   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012 //   See the License for the specific language governing permissions and
00013 //   limitations under the License.
00014 
00015 #include "absl/time/internal/cctz/include/cctz/zone_info_source.h"
00016 
00017 namespace absl {
00018 namespace time_internal {
00019 namespace cctz {
00020 
00021 // Defined out-of-line to avoid emitting a weak vtable in all TUs.
00022 ZoneInfoSource::~ZoneInfoSource() {}
00023 std::string ZoneInfoSource::Version() const { return std::string(); }
00024 
00025 }  // namespace cctz
00026 }  // namespace time_internal
00027 }  // namespace absl
00028 
00029 namespace absl {
00030 namespace time_internal {
00031 namespace cctz_extension {
00032 
00033 namespace {
00034 
00035 // A default for cctz_extension::zone_info_source_factory, which simply
00036 // defers to the fallback factory.
00037 std::unique_ptr<absl::time_internal::cctz::ZoneInfoSource> DefaultFactory(
00038     const std::string& name,
00039     const std::function<std::unique_ptr<absl::time_internal::cctz::ZoneInfoSource>(
00040         const std::string& name)>& fallback_factory) {
00041   return fallback_factory(name);
00042 }
00043 
00044 }  // namespace
00045 
00046 // A "weak" definition for cctz_extension::zone_info_source_factory.
00047 // The user may override this with their own "strong" definition (see
00048 // zone_info_source.h).
00049 #if defined(_MSC_VER)
00050 extern ZoneInfoSourceFactory zone_info_source_factory;
00051 extern ZoneInfoSourceFactory default_factory;
00052 ZoneInfoSourceFactory default_factory = DefaultFactory;
00053 #if defined(_M_IX86)
00054 #pragma comment( \
00055     linker,      \
00056     "/alternatename:?zone_info_source_factory@cctz_extension@time_internal@absl@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@absl@@U?$default_delete@VZoneInfoSource@cctz@time_internal@absl@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@ABV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@absl@@U?$default_delete@VZoneInfoSource@cctz@time_internal@absl@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@5@@ZA=?default_factory@cctz_extension@time_internal@absl@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@absl@@U?$default_delete@VZoneInfoSource@cctz@time_internal@absl@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@ABV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@absl@@U?$default_delete@VZoneInfoSource@cctz@time_internal@absl@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@5@@ZA")
00057 #elif defined(_M_IA_64) || defined(_M_AMD64) || defined(_M_ARM64)
00058 #pragma comment( \
00059     linker,      \
00060     "/alternatename:?zone_info_source_factory@cctz_extension@time_internal@absl@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@absl@@U?$default_delete@VZoneInfoSource@cctz@time_internal@absl@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@AEBV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@absl@@U?$default_delete@VZoneInfoSource@cctz@time_internal@absl@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@5@@ZEA=?default_factory@cctz_extension@time_internal@absl@@3P6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@absl@@U?$default_delete@VZoneInfoSource@cctz@time_internal@absl@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@AEBV?$function@$$A6A?AV?$unique_ptr@VZoneInfoSource@cctz@time_internal@absl@@U?$default_delete@VZoneInfoSource@cctz@time_internal@absl@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@5@@ZEA")
00061 #else
00062 #error Unsupported MSVC platform
00063 #endif
00064 #else  // _MSC_VER
00065 #if !defined(__has_attribute)
00066 #define __has_attribute(x) 0
00067 #endif
00068 #if __has_attribute(weak) || defined(__GNUC__)
00069 ZoneInfoSourceFactory zone_info_source_factory
00070     __attribute__((weak)) = DefaultFactory;
00071 #else
00072 // Make it a "strong" definition if we have no other choice.
00073 ZoneInfoSourceFactory zone_info_source_factory = DefaultFactory;
00074 #endif
00075 #endif  // _MSC_VER
00076 
00077 }  // namespace cctz_extension
00078 }  // namespace time_internal
00079 }  // namespace absl


abseil_cpp
Author(s):
autogenerated on Wed Jun 19 2019 19:42:16