diff options
| author | Stefan Boberg <[email protected]> | 2021-10-15 16:29:38 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-15 16:29:38 +0200 |
| commit | bb258b7bf62c5021d2ccde38107efcfdfc52ddd0 (patch) | |
| tree | 6d641ac4ecc04373e19a9c80776a47ba5b590eaf /zencore/iobuffer.cpp | |
| parent | zencore: added ZEN_THIRD_PARTY_INCLUDES_START/ZEN_THIRD_PARTY_INCLUDES_END (diff) | |
| download | zen-bb258b7bf62c5021d2ccde38107efcfdfc52ddd0.tar.xz zen-bb258b7bf62c5021d2ccde38107efcfdfc52ddd0.zip | |
zencore: Enabled MSC warning 4668 to get warnings when preprocessor macros are used without an explicit definition
Also fixed up various code to compile with this, by using ZEN_THIRD_PARTY_INCLUDES_START/ZEN_THIRD_PARTY_INCLUDES_END macros
Removed prewindows.h/postwindows.h since they are no longer to be used due to the above
Diffstat (limited to 'zencore/iobuffer.cpp')
| -rw-r--r-- | zencore/iobuffer.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/zencore/iobuffer.cpp b/zencore/iobuffer.cpp index 119e37d0b..6cee3f60d 100644 --- a/zencore/iobuffer.cpp +++ b/zencore/iobuffer.cpp @@ -15,7 +15,9 @@ #include <system_error> #if ZEN_USE_MIMALLOC +ZEN_THIRD_PARTY_INCLUDES_START # include <mimalloc.h> +ZEN_THIRD_PARTY_INCLUDES_END #endif #if ZEN_PLATFORM_WINDOWS @@ -390,9 +392,12 @@ IoBufferBuilder::ReadFromFileMaybe(IoBuffer& InBuffer) DWORD dwNumberOfBytesRead = 0; BOOL Success = ::ReadFile(FileRef.FileHandle, OutBuffer.MutableData(), DWORD(NumberOfBytesToRead), &dwNumberOfBytesRead, &Ovl); - ZEN_ASSERT(dwNumberOfBytesRead == NumberOfBytesToRead); + if (!Success) + { + ThrowLastError("ReadFile failed in IoBufferBuilder::ReadFromFileMaybe"); + } - // TODO: error handling + ZEN_ASSERT(dwNumberOfBytesRead == NumberOfBytesToRead); return OutBuffer; #else |