aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-11 18:53:14 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-11 18:53:14 +0100
commitfef0cdfd0c3ed09f8601cfb7e18a64c7bdaba317 (patch)
treeb343c83f57bf720f33fd5c43fbbefcd211150ceb
parent07fda3fa04f9acf9b548c99446155c6dcfce1d2d (diff)
Apple just doesn’t have .st_mtim, fml
-rw-r--r--cbs.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/cbs.h b/cbs.h
index f319ea6..0cffcaf 100644
--- a/cbs.h
+++ b/cbs.h
@@ -55,8 +55,9 @@
# error "Non-POSIX platform detected"
#endif
-/* Required for st_mtim */
-#define _POSIX_C_SOURCE 200809L
+#ifdef __APPLE__
+# define st_mtim st_mtimespec
+#endif
#include <sys/stat.h>
#include <sys/wait.h>
@@ -884,4 +885,8 @@ tpwait(tpool_t *tp)
# pragma GCC diagnostic pop
#endif
+#ifdef __APPLE__
+# undef st_mtim
+#endif
+
#endif /* !C_BUILD_SYSTEM_H */