summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSainnhe Park <sainnhe@gmail.com>2022-07-29 00:19:39 +0800
committerGitHub <noreply@github.com>2022-07-28 18:19:39 +0200
commit28ad6e34cff9906ced0290ae11258260c458d295 (patch)
treed76de0b13afe9b7487f0d4e5fb1ee2faaf4e75f2
parent485e1ed41621d38dae90d378ee568e1eaf439498 (diff)
[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
-rw-r--r--source/modes/filebrowser.c6
1 files changed, 6 insertions, 0 deletions
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.
*/