Fixed WinRT build. (#450)

This commit is contained in:
Branimir Karadžić
2026-10-08 09:44:11 -07:00
committed by GitHub
parent 3fd3d3279e
commit 59a1e105b6
2 changed files with 31 additions and 1 deletions

View File

@@ -851,6 +851,23 @@ namespace bx
return false;
}
if (0 != (st.st_mode & _S_IFREG) )
{
_outFileInfo.type = FileType::File;
}
else if (0 != (st.st_mode & _S_IFDIR) )
{
_outFileInfo.type = FileType::Dir;
}
# elif BX_CRT_MSVC
struct ::_stat64 st;
int32_t result = ::_stat64(_filePath.getCPtr(), &st);
if (0 != result)
{
return false;
}
if (0 != (st.st_mode & _S_IFREG) )
{
_outFileInfo.type = FileType::File;
@@ -898,6 +915,8 @@ namespace bx
? ::_wmkdir(filePath)
: -1
;
#elif BX_CRT_MSVC
int32_t result = ::_mkdir(_filePath.getCPtr() );
#elif BX_CRT_NONE
BX_UNUSED(_filePath);
int32_t result = -1;
@@ -974,6 +993,17 @@ namespace bx
: ::_wremove(filePath)
;
}
#elif BX_CRT_MSVC
int32_t result = -1;
FileInfo fi;
if (stat(fi, _filePath) )
{
result = FileType::Dir == fi.type
? ::_rmdir(_filePath.getCPtr() )
: ::remove(_filePath.getCPtr() )
;
}
#elif BX_CRT_NONE
BX_UNUSED(_filePath);
int32_t result = -1;

View File

@@ -10,7 +10,7 @@
#if BX_PLATFORM_WINDOWS
# include <direct.h> // _wgetcwd
#else
#elif !BX_CRT_MSVC
# include <unistd.h> // getcwd
#endif // BX_PLATFORM_WINDOWS