1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 06:53:53 +00:00

Merge branch 'fix-debug-build' into 'master'

Use correct assertion for the file implementation

See merge request OpenMW/openmw!2163
This commit is contained in:
psi29a 2022-07-19 13:48:57 +00:00
commit 29d8330c5f
3 changed files with 9 additions and 2 deletions

View file

@ -7,11 +7,14 @@
#include <string.h>
#include <stdexcept>
#include <string>
#include <cassert>
namespace Platform::File {
static auto getNativeHandle(Handle handle)
{
assert(handle != Handle::Invalid);
return static_cast<int>(handle);
}

View file

@ -4,11 +4,14 @@
#include <string.h>
#include <string>
#include <stdexcept>
#include <cassert>
namespace Platform::File {
static auto getNativeHandle(Handle handle)
{
assert(handle != Handle::Invalid);
return reinterpret_cast<FILE*>(static_cast<intptr_t>(handle));
}

View file

@ -4,11 +4,14 @@
#include <string>
#include <stdexcept>
#include <boost/locale.hpp>
#include <cassert>
namespace Platform::File {
static auto getNativeHandle(Handle handle)
{
assert(handle != Handle::Invalid);
return reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle));
}
@ -58,8 +61,6 @@ namespace Platform::File {
{
auto nativeHandle = getNativeHandle(handle);
assert(isValidHandle(mHandle));
BY_HANDLE_FILE_INFORMATION info;
if (!GetFileInformationByHandle(nativeHandle, &info))