Merge "Add __libc_format_buffer_va_list." am: fec0e015ce

am: 33b9640132

Change-Id: I6848c4ef176cd04daa8ca1d1799aa69f1a00678d
This commit is contained in:
Josh Gao 2017-02-16 03:53:33 +00:00 committed by android-build-merger
commit f1d42d6acd
2 changed files with 16 additions and 0 deletions

View file

@ -422,6 +422,13 @@ int __libc_format_buffer(char* buffer, size_t buffer_size, const char* format, .
return os.total;
}
int __libc_format_buffer_va_list(char* buffer, size_t buffer_size, const char* format,
va_list args) {
BufferOutputStream os(buffer, buffer_size);
out_vformat(os, format, args);
return os.total;
}
int __libc_format_fd(int fd, const char* format, ...) {
FdOutputStream os(fd);
va_list args;

View file

@ -79,6 +79,15 @@ __noreturn void __fortify_fatal(const char* _Nonnull, ...) __printflike(1, 2);
//
int __libc_format_buffer(char* _Nonnull buf, size_t size, const char* _Nonnull fmt, ...) __printflike(3, 4);
#if defined(__arm__) || defined(__aarch64__) || defined(__x86_64__)
int __libc_format_buffer_va_list(char* _Nonnull buffer, size_t buffer_size,
const char* _Nonnull format, va_list args);
#else // defined(__mips__) || defined(__i386__)
int __libc_format_buffer_va_list(char* _Nonnull buffer, size_t buffer_size,
const char* _Nonnull format, va_list _Nonnull args);
#endif
int __libc_format_fd(int fd, const char* _Nonnull format , ...) __printflike(2, 3);
int __libc_format_log(int pri, const char* _Nonnull tag, const char* _Nonnull fmt, ...) __printflike(3, 4);
#if defined(__arm__) || defined(__aarch64__) || defined(__x86_64__)