Skip to content

Commit f9a4b53

Browse files
committed
Skip stat if _DIRENT_HAVE_D_STAT is set
1 parent 835881a commit f9a4b53

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/FSWrapper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ FSError FSWrapper::FSReadDirWrapper(FSDirectoryHandle handle, FSDirectoryEntry *
9898
if (strcmp(entry_->d_name, ".") == 0 || strcmp(entry_->d_name, "..") == 0) {
9999
entry->info.size = 0;
100100
} else {
101+
#ifdef _DIRENT_HAVE_D_STAT
102+
translate_stat(&entry_->d_stat, &entry->info);
103+
#else
101104
struct stat sb {};
102105
auto path = string_format("%s/%s", dirHandle->path, entry_->d_name);
103106
std::replace(path.begin(), path.end(), '\\', '/');
@@ -120,6 +123,7 @@ FSError FSWrapper::FSReadDirWrapper(FSDirectoryHandle handle, FSDirectoryEntry *
120123
result = FS_ERROR_MEDIA_ERROR;
121124
break;
122125
}
126+
#endif
123127
}
124128
}
125129
result = FS_ERROR_OK;

0 commit comments

Comments
 (0)