diff --git a/src/common.h b/src/common.h index d17bf1cee..3d1f0e581 100644 --- a/src/common.h +++ b/src/common.h @@ -8,12 +8,17 @@ #ifdef GIT_HAS_PTHREAD # include #endif +#include #include #include #include #include #include +#ifndef PRIuPTR +# define PRIuPTR "lu" +#endif + #include "git/common.h" #define GIT_PATH_MAX 4096 diff --git a/src/odb.c b/src/odb.c index 32a550a02..c8df02975 100644 --- a/src/odb.c +++ b/src/odb.c @@ -88,7 +88,7 @@ int git_obj__loose_object_type(git_otype type) static int format_object_header(char *hdr, size_t n, git_obj *obj) { const char *type_str = git_obj_type_to_string(obj->type); - int len = snprintf(hdr, n, "%s %u", type_str, obj->len); + int len = snprintf(hdr, n, "%s %" PRIuPTR, type_str, obj->len); assert(len > 0); /* otherwise snprintf() is broken */ assert(len < n); /* otherwise the caller is broken! */