fix: Compiling of time functions on Unix

This commit is contained in:
WerWolv
2022-01-15 15:03:15 +01:00
parent abac42826c
commit bcbda85a40
6 changed files with 28 additions and 35 deletions

View File

@@ -148,16 +148,9 @@ namespace hex::plugin::builtin::prv {
result.emplace_back("hex.builtin.provider.file.size"_lang, hex::toByteString(this->getActualSize()));
if (this->m_fileStatsValid) {
std::string buffer(0xFF, '\x00');
if (ctime_s(buffer.data(), buffer.size(), &this->m_fileStats.st_ctime) == 0)
result.emplace_back("hex.builtin.provider.file.creation"_lang, buffer);
if (ctime_s(buffer.data(), buffer.size(), &this->m_fileStats.st_atime) == 0)
result.emplace_back("hex.builtin.provider.file.access"_lang, buffer);
if (ctime_s(buffer.data(), buffer.size(), &this->m_fileStats.st_mtime) == 0)
result.emplace_back("hex.builtin.provider.file.modification"_lang, buffer);
result.emplace_back("hex.builtin.provider.file.creation"_lang, hex::format("{}", fmt::localtime(this->m_fileStats.st_ctime)));
result.emplace_back("hex.builtin.provider.file.access"_lang, hex::format("{}", fmt::localtime(this->m_fileStats.st_atime)));
result.emplace_back("hex.builtin.provider.file.modification"_lang, hex::format("{}", fmt::localtime(this->m_fileStats.st_mtime)));
}
return result;