From 28ad6e34cff9906ced0290ae11258260c458d295 Mon Sep 17 00:00:00 2001 From: Sainnhe Park Date: Fri, 29 Jul 2022 00:19:39 +0800 Subject: [filebrowser] Fix st_atim undefined on macOS (#1662) When compiling on macOS, an error message will pop up: ``` error: no member named 'st_atim' in 'struct stat' ``` This is because `st_atim`, `st_ctim` and `st_mtim` does not exist on macOS, instead it uses `st_atimespec`, `st_ctimespec` and `st_mtimespec`. In this commit, 3 macros are defined to try to fix this problem. Reference: https://github.com/hboetes/mg/issues/7 --- source/modes/filebrowser.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/modes/filebrowser.c b/source/modes/filebrowser.c index 2f889471..dc793da6 100644 --- a/source/modes/filebrowser.c +++ b/source/modes/filebrowser.c @@ -50,6 +50,12 @@ #define FILEBROWSER_CACHE_FILE "rofi3.filebrowsercache" +#if defined(__APPLE__) +#define st_atim st_atimespec +#define st_ctim st_ctimespec +#define st_mtim st_mtimespec +#endif + /** * The internal data structure holding the private data of the TEST Mode. */ -- cgit v1.2.3