[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
This commit is contained in:
Sainnhe Park 2022-07-29 00:19:39 +08:00 committed by GitHub
parent 485e1ed416
commit 28ad6e34cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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.
*/