diff options
author | 2024-02-25 02:27:26 +1100 | |
---|---|---|
committer | 2024-02-25 02:27:26 +1100 | |
commit | 1615b8551a3a73532ac234973cfb04dd8ed98ba4 (patch) | |
tree | 25575506b4117afa614b94b4370af7f16eb9dbb5 /src/emu/fileio.cpp | |
parent | 334ec12e0043ef939be418283235e3dbe5a005fe (diff) |
util/ioprocs.cpp: Added wrappers for common patterns. (#11608)
emu/diimage.h: Removed fread overloads that allocate memory for output.
util/core_file.cpp: Changed output size of load to size_t.
Diffstat (limited to 'src/emu/fileio.cpp')
-rw-r--r-- | src/emu/fileio.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/emu/fileio.cpp b/src/emu/fileio.cpp index 23426cb61fa..c0341b93368 100644 --- a/src/emu/fileio.cpp +++ b/src/emu/fileio.cpp @@ -14,6 +14,8 @@ #include "util/path.h" #include "util/unzip.h" +#include <tuple> + //#define VERBOSE 1 #define LOG_OUTPUT_FUNC osd_printf_verbose #include "logmacro.h" @@ -531,9 +533,10 @@ u32 emu_file::read(void *buffer, u32 length) return 0; // read the data if we can + std::error_condition err; size_t actual = 0; if (m_file) - m_file->read(buffer, length, actual); + std::tie(err, actual) = util::read(*m_file, buffer, length); return actual; } @@ -601,9 +604,10 @@ u32 emu_file::write(const void *buffer, u32 length) { // FIXME: need better interface to report errors // write the data if we can + std::error_condition err; size_t actual = 0; if (m_file) - m_file->write(buffer, length, actual); + std::tie(err, actual) = util::write(*m_file, buffer, length); return actual; } |