Export of internal Abseil changes

--
a1b28d83d60f96e14487f093566f12ba07f92732 by Mark Barolak <mbar@google.com>:

Import of CCTZ from GitHub.

PiperOrigin-RevId: 342270204

--
3d99c08b7e2ee23050f64965f09881b54821cdd0 by Mark Barolak <mbar@google.com>:

Fix a Windows DLL breakage that is causing all sub-libraries to be compiled as DLL dependencies instead of stand-alone DLLs.

See https://github.com/abseil/abseil-cpp/issues/796 for the bug report.

Import of https://github.com/abseil/abseil-cpp/pull/797

PiperOrigin-RevId: 341892182
GitOrigin-RevId: a1b28d83d60f96e14487f093566f12ba07f92732
Change-Id: I7d70f07492bfa9b657ec280a4f005c1ee893594c
pull/861/head
Abseil Team 4 years ago committed by Mark Barolak
parent 0453e16533
commit 0bbebc85cd
  1. 6
      CMake/AbseilHelpers.cmake
  2. 8
      absl/time/internal/cctz/src/time_zone_libc.cc
  3. 8
      absl/time/internal/cctz/src/tzfile.h

@ -122,7 +122,11 @@ function(absl_cc_library)
# 4. "static" -- This target does not depend on the DLL and should be built
# statically.
if (${ABSL_BUILD_DLL})
absl_internal_dll_contains(TARGET ${_NAME} OUTPUT _in_dll)
if(ABSL_ENABLE_INSTALL)
absl_internal_dll_contains(TARGET ${_NAME} OUTPUT _in_dll)
else()
absl_internal_dll_contains(TARGET ${ABSL_CC_LIB_NAME} OUTPUT _in_dll)
endif()
if (${_in_dll})
# This target should be replaced by the DLL
set(_build_type "dll")

@ -27,6 +27,12 @@
#include "absl/time/internal/cctz/include/cctz/civil_time.h"
#include "absl/time/internal/cctz/include/cctz/time_zone.h"
#if defined(_AIX)
extern "C" {
extern long altzone;
}
#endif
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace time_internal {
@ -44,7 +50,7 @@ auto tm_zone(const std::tm& tm) -> decltype(_tzname[0]) {
const bool is_dst = tm.tm_isdst > 0;
return _tzname[is_dst];
}
#elif defined(__sun)
#elif defined(__sun) || defined(_AIX)
// Uses the globals: 'timezone', 'altzone' and 'tzname'.
auto tm_gmtoff(const std::tm& tm) -> decltype(timezone) {
const bool is_dst = tm.tm_isdst > 0;

@ -108,15 +108,15 @@ struct tzhead {
#ifndef TZ_MAX_TYPES
/* This must be at least 17 for Europe/Samara and Europe/Vilnius. */
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
#endif /* !defined TZ_MAX_TYPES */
#endif /* !defined TZ_MAX_TYPES */
#ifndef TZ_MAX_CHARS
#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
/* (limited by what unsigned chars can hold) */
#endif /* !defined TZ_MAX_CHARS */
/* (limited by what unsigned chars can hold) */
#endif /* !defined TZ_MAX_CHARS */
#ifndef TZ_MAX_LEAPS
#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
#endif /* !defined TZ_MAX_LEAPS */
#endif /* !defined TZ_MAX_LEAPS */
#endif /* !defined TZFILE_H */

Loading…
Cancel
Save