From 2adeb7aecc3e03849c13c37d71780607464fbfce Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Mon, 8 Jan 2024 07:06:51 +0100 Subject: [PATCH] Fix mac --- code/filesystem.c | 2 +- code/preproc_env.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/filesystem.c b/code/filesystem.c index 7ec9c2e..4e9b454 100644 --- a/code/filesystem.c +++ b/code/filesystem.c @@ -546,7 +546,7 @@ OS_API int64_t OS_GetFileModTime(S8_String file) { struct stat attrib = {}; stat(file.str, &attrib); - struct timespec ts = attrib.st_mtim; + struct timespec ts = attrib.IF_LINUX_ELSE(st_mtim, st_mtimespec); int64_t result = (((int64_t)ts.tv_sec) * 1000000ll) + ((int64_t)ts.tv_nsec) / 1000ll; MA_ReleaseScratch(scratch); diff --git a/code/preproc_env.h b/code/preproc_env.h index 53f4e85..7b12e94 100644 --- a/code/preproc_env.h +++ b/code/preproc_env.h @@ -96,8 +96,10 @@ #if OS_LINUX #define ON_LINUX(x) x + #define IF_LINUX_ELSE(x, y) x #else #define ON_LINUX(x) + #define IF_LINUX_ELSE(x, y) y #endif // #if COMPILER_CLANG