21 _LocaleUpdate locale_update(
nullptr);
22 __crt_lc_time_data const*
const time_data = locale_update.GetLocaleT()->locinfo->lc_time_curr;
25 for (
size_t n = 0;
n < 7; ++
n)
30 __crt_unique_heap_ptr<wchar_t>
buffer(_malloc_crt_t(
wchar_t,
length + 1));
31 if (
buffer.get() ==
nullptr)
34 wchar_t* it =
buffer.get();
35 for (
size_t n = 0;
n < 7; ++
n)
53 _LocaleUpdate locale_update(
nullptr);
54 __crt_lc_time_data const*
const time_data = locale_update.GetLocaleT()->locinfo->lc_time_curr;
57 for (
size_t n = 0;
n < 12; ++
n)
62 __crt_unique_heap_ptr<wchar_t>
buffer(_malloc_crt_t(
wchar_t,
length + 1));
63 if (
buffer.get() ==
nullptr)
66 wchar_t* it =
buffer.get();
67 for (
size_t n = 0;
n < 12; ++
n)
85 _LocaleUpdate locale_update(
nullptr);
90 #define PROCESS_STRING(STR, CHAR, CPY, LEN) \
91 while (bytes % sizeof(CHAR) != 0) \
97 dest->STR = ((CHAR *) dest) + bytes / sizeof(CHAR); \
98 _ERRCHECK(CPY(dest->STR, (total_bytes - bytes) / sizeof(CHAR), src->STR)); \
100 bytes += (LEN(src->STR) + 1) * sizeof(CHAR);
102 #define PROCESS_NARROW_STRING(STR) \
103 PROCESS_STRING(STR, char, strcpy_s, strlen)
105 #define PROCESS_WIDE_STRING(STR) \
106 PROCESS_STRING(STR, wchar_t, wcscpy_s, wcslen)
108 #define PROCESS_NARROW_ARRAY(ARR) \
109 for (size_t idx = 0; idx < _countof(src->ARR); ++idx) \
111 PROCESS_NARROW_STRING(ARR[idx]) \
114 #define PROCESS_WIDE_ARRAY(ARR) \
115 for (size_t idx = 0; idx < _countof(src->ARR); ++idx) \
117 PROCESS_WIDE_STRING(ARR[idx]) \
121 size_t total_bytes = 0;
125 for (
int phase = 0; phase < 2; ++phase)
153 dest->ww_caltype =
src->ww_caltype;
184#define _CrtWcstime_Writes_and_advances_ptr_(count) \
185 _Outptr_result_buffer_(count)
221 wchar_t* out_it = *
out;
226 *out_it++ =
static_cast<wchar_t>(
value % 10 +
L'0');
242 wchar_t*
right = out_it - 1;
266 wchar_t const pad_character
269 if (pad_character ==
'\0')
282 (*out)[
digits] =
static_cast<wchar_t>(
L'0' +
value % 10);
286 (*out)[
digits] = pad_character;
322 int const adjusted_wday{(wday + 7 - wstart) % 7};
323 return (yday + 7 - adjusted_wday) / 7;
331 int const yunleap{yday - is_leap_year};
332 int const jan1{(371 - yday + wday) % 7};
333 int const dec32{(jan1 + is_leap_year + 365) % 7};
335 if ((364 <= yunleap && dec32 ==
tuesday ) ||
336 (363 <= yunleap && dec32 ==
wednesday) ||
337 (362 <= yunleap && dec32 ==
thursday ))
343 return week_number + 1;
353 if (week_number == 0)
366 if (week_number == 0)
400static bool __cdecl store_winword(
452 __crt_scoped_stack_ptr<wchar_t>
const buffer(_malloca_crt_t(
wchar_t,
cch));
453 if (
buffer.get() !=
nullptr)
462 wchar_t const* buffer_it =
buffer.get();
465 *(*out)++ = *buffer_it++;
479 bool no_lead_zeros =
false;
495 case 1: no_lead_zeros =
true;
507 case 1: no_lead_zeros =
true;
529 case 1: no_lead_zeros =
true;
539 case 1: no_lead_zeros =
true;
549 case 1: no_lead_zeros =
true;
559 case 1: no_lead_zeros =
true;
589 *(*out)++ = *ampmstr++;
594 while (*ampmstr != 0 && *
count > 0)
596 *(*out)++ = *ampmstr++;
661 wchar_t**
const string,
664 bool const alternate_form
930 unsigned week_number = 0;
996 long const hours_offset {(positive_offset / 60) / 60};
997 long const minutes_offset{(positive_offset / 60) % 60};
1002 wchar_t const*
const sign_string{
offset <= 0 ?
L"+" :
L"-"};
1050 wchar_t*
const string,
1052 wchar_t const*
const format,
1064 _LocaleUpdate locale_update(
locale);
1067 ? locale_update.GetLocaleT()->locinfo->lc_time_curr
1075 wchar_t* string_it =
string;
1076 wchar_t const* format_it =
format;
1078 bool failed =
false;
1081 while (remaining > 0)
1099 bool alternate_form =
false;
1100 if (*format_it ==
L'#')
1102 alternate_form =
true;
1108 if (*format_it ==
L'E' || *format_it ==
L'O')
1131 *string_it++ = *format_it++;
1143 if (!failed && remaining > 0)
1156 if (!failed && remaining <= 0)
1173 wchar_t const*
const format,
1184 wchar_t const*
const format,
1195 wchar_t const*
const format,
static unsigned char bytes[4]
__crt_lc_time_data const __lc_time_c
int WINAPI __acrt_GetDateFormatEx(_In_opt_ LPCWSTR locale_name, _In_ DWORD flags, _In_opt_ SYSTEMTIME CONST *date, _In_opt_ LPCWSTR format, _Out_writes_opt_(buffer_count) LPWSTR buffer, _In_opt_ int buffer_count, _In_opt_ LPCWSTR calendar)
int WINAPI __acrt_GetTimeFormatEx(_In_opt_ LPCWSTR locale_name, _In_ DWORD flags, _In_opt_ SYSTEMTIME CONST *time, _In_opt_ LPCWSTR format, _Out_writes_opt_(buffer_count) LPWSTR buffer, _In_opt_ int buffer_count)
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
_Check_return_ _Deref_ret_z_ wchar_t **__cdecl __wide_tzname()
_In_ size_t _In_z_ wchar_t const _In_ tm const _In_opt_ void * lc_time_arg
bool __cdecl __crt_time_is_leap_year(TimeType const yr)
int __crt_get_century(int const year)
int __crt_get_2digit_year(int const year)
_In_ size_t _In_z_ wchar_t const _In_ tm const * timeptr
static const WCHAR month[12][4]
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLuint GLsizei GLsizei * length
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define _VALIDATE_RETURN_NOEXC(expr, errorcode, retexpr)
static const int digits[]
#define wcscpy_s(d, l, s)
static DWORD DWORD void LPSTR DWORD cch
#define _In_reads_or_z_(s)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP errno_t __cdecl _get_dstbias(_Out_ long *_Daylight_savings_bias)
_CRTIMP errno_t __cdecl _get_timezone(_Out_ long *_Timezone)
wchar_t * _W_month_abbr[12]
wchar_t * _W_wday_abbr[7]
#define _CrtWcstime_Writes_and_advances_ptr_(count)
static void __cdecl store_string(_In_reads_or_z_(*count) wchar_t const *in, _CrtWcstime_Writes_and_advances_ptr_(*count) wchar_t **const out, _Inout_ size_t *const count)
static int __cdecl compute_iso_year(int const year, int const wday, int const yday)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t _Inout_ size_t __crt_lc_time_data const bool alternate_form throw()
wchar_t *__cdecl _W_Getmonths()
#define PROCESS_NARROW_STRING(STR)
size_t __cdecl _Wcsftime_l(wchar_t *const string, size_t const max_size, wchar_t const *const format, tm const *const timeptr, void *const lc_time_arg, _locale_t const locale)
size_t __cdecl _wcsftime_l(wchar_t *const buffer, size_t const max_size, wchar_t const *const format, tm const *const timeptr, _locale_t const locale)
static void __cdecl store_number(int value, int digits, _CrtWcstime_Writes_and_advances_ptr_(*count) wchar_t **const out, _Inout_ size_t *const count, wchar_t const pad_character)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
static int compute_week_of_year(int const wstart, int const wday, int const yday)
wchar_t *__cdecl _W_Getdays()
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t _Inout_ size_t * count
static int __cdecl compute_iso_week(int const year, int const wday, int const yday)
static bool __cdecl expand_time(_locale_t const locale, wchar_t const specifier, tm const *const timeptr, wchar_t **const string, size_t *const left, __crt_lc_time_data const *const lc_time, bool const alternate_form)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t _Inout_ size_t __crt_lc_time_data const * lc_time
#define PROCESS_NARROW_ARRAY(ARR)
#define PROCESS_WIDE_STRING(STR)
void *__cdecl _W_Gettnames()
size_t __cdecl wcsftime(wchar_t *const buffer, size_t const max_size, wchar_t const *const format, tm const *const timeptr)
size_t __cdecl _Wcsftime(wchar_t *const buffer, size_t const max_size, wchar_t const *const format, tm const *const timeptr, void *const lc_time_arg)
static void __cdecl store_number_without_lead_zeroes(int value, _CrtWcstime_Writes_and_advances_ptr_(*count) wchar_t **const out, _Inout_ size_t *const count)
#define PROCESS_WIDE_ARRAY(ARR)
static int __cdecl compute_iso_week_internal(int year, int wday, int yday)