mirror of
https://github.com/bkaradzic/bx.git
synced 2026-10-22 08:41:00 +00:00
Fixed WinRT build. (#450)
This commit is contained in:
committed by
GitHub
parent
3fd3d3279e
commit
59a1e105b6
30
src/file.cpp
30
src/file.cpp
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user