diff --git a/git-compat-util.h b/git-compat-util.h
index 878d83dd0863570042af80919899b4d6aa57e35b..19062534a1d8c8e46e77045cb9e67f437f619133 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
# define FORCE_DIR_SET_GID 0
#endif
+#ifdef NO_NSEC
+#undef USE_NSEC
+#define ST_CTIME_NSEC(st) 0
+#define ST_MTIME_NSEC(st) 0
+#else
+#ifdef USE_ST_TIMESPEC
+#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctimespec.tv_nsec))
+#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtimespec.tv_nsec))
+#else
+#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctim.tv_nsec))
+#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtim.tv_nsec))
+#endif
+#endif
+
#endif