From cefce84f5eb95884344c3f97fc710d4ac0626359 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Fri, 16 May 2025 23:32:08 +0300 Subject: =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zsh/theme/gitstatus/src/stat.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 zsh/theme/gitstatus/src/stat.h (limited to 'zsh/theme/gitstatus/src/stat.h') diff --git a/zsh/theme/gitstatus/src/stat.h b/zsh/theme/gitstatus/src/stat.h new file mode 100644 index 0000000..4f3195a --- /dev/null +++ b/zsh/theme/gitstatus/src/stat.h @@ -0,0 +1,23 @@ +#ifndef ROMKATV_GITSTATUS_STAT_H_ +#define ROMKATV_GITSTATUS_STAT_H_ + +#include + +namespace gitstatus { + +inline const struct timespec& MTim(const struct stat& s) { +#ifdef __APPLE__ + return s.st_mtimespec; +#else + return s.st_mtim; +#endif +} + +inline bool StatEq(const struct stat& x, const struct stat& y) { + return MTim(x).tv_sec == MTim(y).tv_sec && MTim(x).tv_nsec == MTim(y).tv_nsec && + x.st_size == y.st_size && x.st_ino == y.st_ino && x.st_mode == y.st_mode; +} + +} // namespace gitstatus + +#endif // ROMKATV_GITSTATUS_STAT_H_ -- cgit v1.2.3