tweaks for windows compile

This commit is contained in:
Hieu Hoang 2019-10-27 10:52:02 -07:00
parent 463b29c4e8
commit 86533709d4
2 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,8 @@
#ifdef _MSC_VER
#include <io.h>
#include <windows.h>
#include <fcntl.h>
#include <stdlib.h>
#else
#include <sys/types.h>
#include <unistd.h>

View File

@ -53,7 +53,7 @@ public:
template <typename T>
size_t write(const T* ptr, size_t num = 1) {
this->write((char*)ptr, num * sizeof(T));
std::ostream::write((char*)ptr, num * sizeof(T));
// fail() seems to be correct here. Failure to write should abort.
ABORT_IF(fail(), "Error writing to file '{}'", file_.string());
return num * sizeof(T);