diff --git a/git-compat-util.h b/git-compat-util.h
index 545df5924247c9d4ffe700db6c158715561f6a62..cf89cdf4598b3796724a85aa707f740245155cdc 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
#define PRIuMAX "llu"
#endif
+#ifndef PRIu32
+#define PRIu32 "u"
+#endif
+
+#ifndef PRIx32
+#define PRIx32 "x"
+#endif
+
#ifndef PATH_SEP
#define PATH_SEP ':'
#endif
@@ -149,6 +157,12 @@ extern void set_warn_routine(void (*routine)(const char *warn, va_list params));
extern int prefixcmp(const char *str, const char *prefix);
extern time_t tm_to_time_t(const struct tm *tm);
+static inline const char *skip_prefix(const char *str, const char *prefix)
+{
+ size_t len = strlen(prefix);
+ return strncmp(str, prefix, len) ? NULL : str + len;
+}
+
#ifdef NO_MMAP
#ifndef PROT_READ