]> Pileus Git - ~andy/git/blobdiff - git-compat-util.h
compat: introduce on_disk_bytes()
[~andy/git] / git-compat-util.h
index cf89cdf4598b3796724a85aa707f740245155cdc..1b40dbd5358ab3f1f947930daa1b8b4cfd4d5fe1 100644 (file)
@@ -192,6 +192,12 @@ extern int git_munmap(void *start, size_t length);
 
 #endif /* NO_MMAP */
 
+#ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
+#define on_disk_bytes(st) ((st).st_size)
+#else
+#define on_disk_bytes(st) ((st).st_blocks * 512)
+#endif
+
 #define DEFAULT_PACKED_GIT_LIMIT \
        ((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))