From 2bb2d3fe0181914af60457aa4ca90b8c4bcfb3de Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 18 Feb 2024 23:45:39 +0100 Subject: [PATCH] CFileSystem: Fix signed integer conversion on MinGW --- source/Irrlicht/CFileSystem.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/source/Irrlicht/CFileSystem.cpp b/source/Irrlicht/CFileSystem.cpp index 0bb24a19..58982154 100644 --- a/source/Irrlicht/CFileSystem.cpp +++ b/source/Irrlicht/CFileSystem.cpp @@ -745,15 +745,10 @@ IFileList* CFileSystem::createFileList() r = new CFileList(Path, true, false); - // TODO: Should be unified once mingw adapts the proper types -#if defined(__GNUC__) - long hFile; //mingw return type declaration -#else + // intptr_t is optional but supported by MinGW since 2007 or earlier. intptr_t hFile; -#endif - struct _tfinddata_t c_file; - if( (hFile = _tfindfirst( _T("*"), &c_file )) != -1L ) + if( (hFile = _tfindfirst( _T("*"), &c_file )) != (intptr_t)(-1L) ) { do {