60static transitiondate
dstend = { -1, 0, 0 };
78 size_t required_length;
90 __crt_unique_heap_ptr<wchar_t> dynamic_buffer(_malloc_crt_t(
wchar_t, required_length));
91 if (dynamic_buffer.get() ==
nullptr)
97 if (
_wgetenv_s(&actual_length, dynamic_buffer.get(), required_length,
L"TZ") != 0)
102 return dynamic_buffer.detach();
200 _set_dstbias(dstbias);
220 static_cast<int>(tzname_length),
247 auto new_wide_tz = _malloc_crt_t(
wchar_t,
wcslen(tz_env) + 1);
264 rsize_t const tzname_length = 3;
281 bool const is_negative_difference = *tz_env ==
L'-';
282 if (is_negative_difference)
288 int const decimal_base = 10;
292 while (*tz_env ==
'+' || (*tz_env >=
L'0' && *tz_env <=
L'9'))
303 while (*tz_env >=
L'0' && *tz_env <=
L'9')
313 while (*tz_env >=
L'0' && *tz_env <=
L'9')
320 if (is_negative_difference)
353 __crt_unique_heap_ptr<wchar_t> tz_env_cleanup(tz_env == local_env_buffer
360 if (tz_env ==
nullptr || tz_env[0] ==
'\0')
394 auto const first_time =
tzset_init_state.dangerous_get_state_array() + __crt_state_management::get_current_state_index();
396 if (__crt_interlocked_read(first_time) != 0)
404 if (__crt_interlocked_read(first_time) != 0)
456 monthdow = (yearday + ((year - 70) * 365) +
460 if (monthdow <= dayofweek)
461 yearday += (dayofweek - monthdow) + (week - 1) * 7;
463 yearday += (dayofweek - monthdow) + week * 7;
472 if (week == 5 && yearday > days_to_compare)
489 dststart.ms = msec + (1000 * (sec + 60 * (
min + 60 * hour)));
498 dstend.ms = msec + (1000 * (sec + 60 * (
min + 60 * hour)));
504 dstend.ms += (dstbias * 1000);
621 if (107 >
tb->tm_year)
677 long const ms = 1000 * (
tb->tm_sec + 60 *
tb->tm_min + 3600 *
tb->tm_hour);
686 return ms <
dstend.ms ? 1 : 0;
return __acrt_WideCharToMultiByte(code_page, 0, buffer.get(), -1, result_size !=0 ? result :nullptr, result_size, nullptr, nullptr)
void __cdecl __acrt_unlock(_In_ __acrt_lock_id lock)
#define _DEFINE_SET_FUNCTION(function_name, type, variable_name)
_Out_opt_ UINT * code_page
_Check_return_ _Deref_ret_z_ wchar_t **__cdecl __wide_tzname()
bool __cdecl __crt_time_is_leap_year(TimeType const yr)
TimeType __cdecl __crt_time_elapsed_leap_years(TimeType const yr)
unsigned int __acrt_get_utf8_acp_compatibility_codepage()
result_buffer_count char *const _In_ int const _In_ bool const _In_ unsigned const _In_ STRFLT const _In_ bool const _Inout_ __crt_cached_ptd_host &ptd throw()
__acrt_lock(__acrt_heap_lock)
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
static const WCHAR month[12][4]
errno_t __cdecl _wgetenv_s(size_t *const required_count, wchar_t *const buffer, size_t const buffer_count, wchar_t const *const name)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP unsigned int __cdecl ___lc_codepage_func(void)
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define _BEGIN_SECURE_CRT_DEPRECATION_DISABLE
#define _END_SECURE_CRT_DEPRECATION_DISABLE
long __cdecl _InterlockedIncrement(_Interlocked_operand_ long volatile *_Addend)
#define wcscpy_s(d, l, s)
#define wcsncpy_s(d, l, s, n)
size_t const local_env_buffer_size
int const milliseconds_per_day
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP errno_t __cdecl _get_daylight(_Out_ int *_Daylight)
_CRTIMP errno_t __cdecl _get_dstbias(_Out_ long *_Daylight_savings_bias)
_CRTIMP errno_t __cdecl _get_timezone(_Out_ long *_Timezone)
static transitiondate dstend
static void __cdecl tzset_from_environment_nolock(_In_z_ wchar_t *tz_env)
static __crt_state_management::dual_state_global< long > tzset_init_state
int __cdecl _isindst(tm *const tb)
static int __cdecl _isindst_nolock(tm *const tb)
static wchar_t * get_tz_environment_variable(wchar_t(&local_buffer)[local_env_buffer_size])
static void __cdecl cvtdate(transition_type const trantype, date_type const datetype, int const year, int const month, int const week, int const dayofweek, int const date, int const hour, int const min, int const sec, int const msec)
static void __cdecl tzset_env_copy_to_tzname(const wchar_t *const tz_env, wchar_t *const wide_tzname, char *const narrow_tzname, rsize_t const tzname_length)
static void __cdecl tzset_from_system_nolock()
static wchar_t * last_wide_tz
static void __cdecl tzset_nolock()
static TIME_ZONE_INFORMATION tz_info
static void __cdecl tzset_os_copy_to_tzname(const wchar_t *const timezone_name, wchar_t *const wide_tzname, char *const narrow_tzname, unsigned int const code_page)
static transitiondate dststart