Code

I like the idea of the new ':/<oneline prefix>' notation, and gave it
[git.git] / git-compat-util.h
index 56212b2f115d0ef738c5835c42d7bf241db4576a..7534db1267bfa64a4a0cba80680fefc42177f0e8 100644 (file)
 #define PATH_MAX 4096
 #endif
 
+#ifndef PRIuMAX
+#define PRIuMAX "llu"
+#endif
+
 #ifdef __GNUC__
 #define NORETURN __attribute__((__noreturn__))
 #else
@@ -254,6 +258,11 @@ static inline ssize_t xwrite(int fd, const void *buf, size_t len)
        }
 }
 
+static inline size_t xsize_t(off_t len)
+{
+       return (size_t)len;
+}
+
 static inline int has_extension(const char *filename, const char *ext)
 {
        size_t len = strlen(filename);