From 5e22b0d77a35a825bffc66b0eb0392324abf45d6 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Wed, 17 Jan 2024 21:21:16 -0600 Subject: [PATCH] fixed: MacOS compilation --- shared/include/bh.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shared/include/bh.h b/shared/include/bh.h index 76bf84a4..4a3eaa48 100644 --- a/shared/include/bh.h +++ b/shared/include/bh.h @@ -1919,9 +1919,17 @@ b32 bh_file_stat(char const* filename, bh_file_stats* out) { } out->size = s.st_size; + +#if defined(_BH_DARWIN) + // Apple just has to be different. + out->modified_time = timespec_to_ms(s.st_mtimespec); + out->accessed_time = timespec_to_ms(s.st_atimespec); + out->change_time = timespec_to_ms(s.st_ctimespec); +#else out->modified_time = timespec_to_ms(s.st_mtim); out->accessed_time = timespec_to_ms(s.st_atim); out->change_time = timespec_to_ms(s.st_ctim); +#endif if ((s.st_mode & S_IFMT) == S_IFDIR) out->file_type = BH_FILE_TYPE_DIRECTORY; if ((s.st_mode & S_IFMT) == S_IFREG) out->file_type = BH_FILE_TYPE_FILE; -- 2.25.1