Created
December 8, 2019 14:54
-
-
Save Const-me/f1bb320969adde6c79694265ea644b9d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <template <typename, typename> class Base, typename Character> | |
static int __cdecl common_vfprintf( | |
unsigned __int64 const options, | |
FILE* const stream, | |
Character const* const format, | |
_locale_t const locale, | |
va_list const arglist | |
) throw() | |
{ | |
typedef output_processor< | |
Character, | |
stream_output_adapter<Character>, | |
Base<Character, stream_output_adapter<Character>> | |
> processor_type; | |
_VALIDATE_RETURN(stream != nullptr, EINVAL, -1); | |
_VALIDATE_RETURN(format != nullptr, EINVAL, -1); | |
return __acrt_lock_stream_and_call(stream, [&]() -> int | |
{ | |
__acrt_stdio_temporary_buffering_guard const buffering(stream); | |
_LocaleUpdate locale_update(locale); | |
processor_type processor( | |
stream_output_adapter<Character>(stream), | |
options, | |
format, | |
locale_update.GetLocaleT(), | |
arglist); | |
return processor.process(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment