Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(571)

Unified Diff: util/file/file_io.h

Issue 1023943003: crashpad_database_util: Accept --new-report=- to read a new report from standard input (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@crashpad_database_util_new_report
Patch Set: Rebase Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: util/file/file_io.h
diff --git a/util/file/file_io.h b/util/file/file_io.h
index 5d5a957d79b3eb19861d314ed3e26d532849555d..c03fc1d9ce7de86214179a9052fae2dc07d7c06f 100644
--- a/util/file/file_io.h
+++ b/util/file/file_io.h
@@ -26,6 +26,27 @@
#include "util/win/scoped_handle.h"
#endif
+//! \file
+
+#if defined(OS_POSIX) || DOXYGEN
+
+//! \brief A `PLOG()` macro usable for standard input/output error conditions.
+//!
+//! The `PLOG()` macro uses `errno` on POSIX and is appropriate to report
+//! errors from standard input/output functions. On Windows, `PLOG()` uses
+//! `GetLastError()`, and cannot be used to report errors from standard
+//! input/output functions. This macro uses `PLOG()` when appropriate for
+//! standard I/O functions, and `LOG()` otherwise.
+#define STDIO_PLOG(x) PLOG(x)
+
+#else
+
+#define STDIO_PLOG(x) LOG(x)
+#define fseeko(file, offset, whence) _fseeki64(file, offset, whence)
+#define ftello(file) _ftelli64(file)
+
+#endif
+
namespace base {
class FilePath;
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698