zone_info_source.cc
Go to the documentation of this file.
1 // Copyright 2016 Google Inc. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
16 
17 namespace absl {
18 namespace time_internal {
19 namespace cctz {
20 
21 // Defined out-of-line to avoid emitting a weak vtable in all TUs.
23 std::string ZoneInfoSource::Version() const { return std::string(); }
24 
25 } // namespace cctz
26 } // namespace time_internal
27 } // namespace absl
28 
29 namespace absl {
30 namespace time_internal {
31 namespace cctz_extension {
32 
33 namespace {
34 
35 // A default for cctz_extension::zone_info_source_factory, which simply
36 // defers to the fallback factory.
37 std::unique_ptr<absl::time_internal::cctz::ZoneInfoSource> DefaultFactory(
38  const std::string& name,
39  const std::function<std::unique_ptr<absl::time_internal::cctz::ZoneInfoSource>(
40  const std::string& name)>& fallback_factory) {
41  return fallback_factory(name);
42 }
43 
44 } // namespace
45 
46 // A "weak" definition for cctz_extension::zone_info_source_factory.
47 // The user may override this with their own "strong" definition (see
48 // zone_info_source.h).
49 #if defined(_MSC_VER)
51 extern ZoneInfoSourceFactory default_factory;
52 ZoneInfoSourceFactory default_factory = DefaultFactory;
53 #if defined(_M_IX86)
54 #pragma comment( \
55  linker, \
56  "/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")
57 #elif defined(_M_IA_64) || defined(_M_AMD64) || defined(_M_ARM64)
58 #pragma comment( \
59  linker, \
60  "/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")
61 #else
62 #error Unsupported MSVC platform
63 #endif
64 #else // _MSC_VER
65 #if !defined(__has_attribute)
66 #define __has_attribute(x) 0
67 #endif
68 #if __has_attribute(weak) || defined(__GNUC__)
69 ZoneInfoSourceFactory zone_info_source_factory
70  __attribute__((weak)) = DefaultFactory;
71 #else
72 // Make it a "strong" definition if we have no other choice.
73 ZoneInfoSourceFactory zone_info_source_factory = DefaultFactory;
74 #endif
75 #endif // _MSC_VER
76 
77 } // namespace cctz_extension
78 } // namespace time_internal
79 } // namespace absl
ZoneInfoSourceFactory zone_info_source_factory
virtual std::string Version() const
Definition: algorithm.h:29
char name[1]
Definition: mutex.cc:296
std::unique_ptr< absl::time_internal::cctz::ZoneInfoSource >(*)(const std::string &, const std::function< std::unique_ptr< absl::time_internal::cctz::ZoneInfoSource >(const std::string &)> &) ZoneInfoSourceFactory


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