diff --git a/components/platform/file.posix.cpp b/components/platform/file.posix.cpp index efffa0fd76..f79562dcfd 100644 --- a/components/platform/file.posix.cpp +++ b/components/platform/file.posix.cpp @@ -7,11 +7,14 @@ #include #include #include +#include namespace Platform::File { static auto getNativeHandle(Handle handle) { + assert(handle != Handle::Invalid); + return static_cast(handle); } diff --git a/components/platform/file.stdio.cpp b/components/platform/file.stdio.cpp index 26c2480902..558fea1154 100644 --- a/components/platform/file.stdio.cpp +++ b/components/platform/file.stdio.cpp @@ -4,11 +4,14 @@ #include #include #include +#include namespace Platform::File { static auto getNativeHandle(Handle handle) { + assert(handle != Handle::Invalid); + return reinterpret_cast(static_cast(handle)); } diff --git a/components/platform/file.win32.cpp b/components/platform/file.win32.cpp index ad7e11213d..a2ba86a4ef 100644 --- a/components/platform/file.win32.cpp +++ b/components/platform/file.win32.cpp @@ -4,11 +4,14 @@ #include #include #include +#include namespace Platform::File { static auto getNativeHandle(Handle handle) { + assert(handle != Handle::Invalid); + return reinterpret_cast(static_cast(handle)); } @@ -58,8 +61,6 @@ namespace Platform::File { { auto nativeHandle = getNativeHandle(handle); - assert(isValidHandle(mHandle)); - BY_HANDLE_FILE_INFORMATION info; if (!GetFileInformationByHandle(nativeHandle, &info))