updated build system
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit

This commit is contained in:
2024-08-23 16:54:00 -05:00
parent 46490f9930
commit c0be6765ab
3 changed files with 10 additions and 4 deletions

View File

@ -55,6 +55,8 @@ void get_local_time_now(struct tm &local_time);
#if defined(_WIN32)
auto strptime(const char *s, const char *f, struct tm *tm) -> const char *;
[[nodiscard]] auto time64_to_unix_time(const __time64_t &time) -> std::uint64_t;
[[nodiscard]] auto unix_time_to_filetime(std::uint64_t unix_time) -> FILETIME;
#endif // defined(_WIN32)

View File

@ -58,11 +58,11 @@ auto traverse_directory(
::FindClose(find);
#else // !defined(_WIN32)
auto *root = opendir(path.c_str());
auto *root = opendir(std::string{path}.c_str());
if (root == nullptr) {
throw std::runtime_error("failed to open directory|" + std::string{path} +
'|' +
std::to_string(utils::get_last_error_code()));
throw std::runtime_error(
"failed to open directory|" + std::string{path} + '|' +
std::to_string(repertory::utils::get_last_error_code()));
}
struct dirent *de{};

View File

@ -66,6 +66,10 @@ auto strptime(const char *s, const char *f, struct tm *tm) -> const char * {
return reinterpret_cast<const char *>(s + input.tellg());
}
auto time64_to_unix_time(const __time64_t &time) -> std::uint64_t {
return static_cast<std::uint64_t>(time * NANOS_PER_SECOND);
}
// https://www.frenk.com/2009/12/convert-filetime-to-unix-timestamp/
auto unix_time_to_filetime(std::uint64_t unix_time) -> FILETIME {
auto win_time =