mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Fixed MSVC stat issue.
This commit is contained in:
@@ -294,7 +294,25 @@ namespace bx
|
||||
_fileInfo.m_size = 0;
|
||||
_fileInfo.m_type = FileInfo::Count;
|
||||
|
||||
struct stat st;
|
||||
#if BX_COMPILER_MSVC
|
||||
struct ::_stat64 st;
|
||||
int32_t result = ::_stat64(_filePath, &st);
|
||||
|
||||
if (0 != result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (0 != (st.st_mode & _S_IFREG) )
|
||||
{
|
||||
_fileInfo.m_type = FileInfo::Regular;
|
||||
}
|
||||
else if (0 != (st.st_mode & _S_IFDIR) )
|
||||
{
|
||||
_fileInfo.m_type = FileInfo::Directory;
|
||||
}
|
||||
#else
|
||||
struct ::stat st;
|
||||
int32_t result = ::stat(_filePath, &st);
|
||||
if (0 != result)
|
||||
{
|
||||
@@ -309,6 +327,7 @@ namespace bx
|
||||
{
|
||||
_fileInfo.m_type = FileInfo::Directory;
|
||||
}
|
||||
#endif // BX_COMPILER_MSVC
|
||||
|
||||
_fileInfo.m_size = st.st_size;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user