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

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: Fix Windows Created 5 years, 4 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
« no previous file with comments | « tools/crashpad_database_util.cc ('k') | util/file/file_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/file/file_io.h
diff --git a/util/file/file_io.h b/util/file/file_io.h
index c3120c9639875cff165c4b2acca0c5fd072fc232..0be3563fd58d81cb1d121e50685a1d1880fbdfae 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
« no previous file with comments | « tools/crashpad_database_util.cc ('k') | util/file/file_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698