diff options
Diffstat (limited to 'Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc')
-rw-r--r-- | Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc b/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc index 86e34d4..1ce1388 100644 --- a/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +++ b/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc @@ -20,6 +20,7 @@ #include <cstdlib> #include <cstring> +#include "absl/base/attributes.h" #include "absl/base/config.h" #include "absl/base/internal/atomic_hook.h" #include "absl/base/log_severity.h" @@ -35,7 +36,7 @@ // This preprocessor token is also defined in raw_io.cc. If you need to copy // this, consider moving both to config.h instead. #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ - defined(__Fuchsia__) + defined(__Fuchsia__) || defined(__native_client__) #include <unistd.h> @@ -81,6 +82,8 @@ static const char kTruncated[] = " ... (message truncated)\n"; // consumed bytes, and return whether the message fit without truncation. If // truncation occurred, if possible leave room in the buffer for the message // kTruncated[]. +inline static bool VADoRawLog(char** buf, int* size, const char* format, + va_list ap) ABSL_PRINTF_ATTRIBUTE(3, 0); inline static bool VADoRawLog(char** buf, int* size, const char* format, va_list ap) { int n = vsnprintf(*buf, *size, format, ap); @@ -101,12 +104,6 @@ inline static bool VADoRawLog(char** buf, int* size, static constexpr int kLogBufSize = 3000; -namespace absl { -namespace raw_logging_internal { -void SafeWriteToStderr(const char *s, size_t len); -} // namespace raw_logging_internal -} // namespace absl - namespace { // CAVEAT: vsnprintf called from *DoRawLog below has some (exotic) code paths @@ -129,6 +126,8 @@ bool DoRawLog(char** buf, int* size, const char* format, ...) { } void RawLogVA(absl::LogSeverity severity, const char* file, int line, + const char* format, va_list ap) ABSL_PRINTF_ATTRIBUTE(4, 0); +void RawLogVA(absl::LogSeverity severity, const char* file, int line, const char* format, va_list ap) { char buffer[kLogBufSize]; char* buf = buffer; @@ -183,12 +182,6 @@ void RawLogVA(absl::LogSeverity severity, const char* file, int line, namespace absl { namespace raw_logging_internal { - -// Writes the provided buffer directly to stderr, in a safe, low-level manner. -// -// In POSIX this means calling write(), which is async-signal safe and does -// not malloc. If the platform supports the SYS_write syscall, we invoke that -// directly to side-step any libc interception. void SafeWriteToStderr(const char *s, size_t len) { #if defined(ABSL_HAVE_SYSCALL_WRITE) syscall(SYS_write, STDERR_FILENO, s, len); @@ -204,6 +197,8 @@ void SafeWriteToStderr(const char *s, size_t len) { } void RawLog(absl::LogSeverity severity, const char* file, int line, + const char* format, ...) ABSL_PRINTF_ATTRIBUTE(4, 5); +void RawLog(absl::LogSeverity severity, const char* file, int line, const char* format, ...) { va_list ap; va_start(ap, format); |