X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-compat-util.h;h=139fc19108cab51eb23659868ef8600ff6b25795;hb=68faf68938ee943fc251c702f2027e4dfda354db;hp=56212b2f115d0ef738c5835c42d7bf241db4576a;hpb=e6f95113431f7e69263bc3d075c0a7715ce587e3;p=git.git diff --git a/git-compat-util.h b/git-compat-util.h index 56212b2f1..139fc1910 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -70,6 +70,10 @@ #define PATH_MAX 4096 #endif +#ifndef PRIuMAX +#define PRIuMAX "llu" +#endif + #ifdef __GNUC__ #define NORETURN __attribute__((__noreturn__)) #else @@ -83,7 +87,7 @@ extern void usage(const char *err) NORETURN; extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2))); extern int error(const char *err, ...) __attribute__((format (printf, 1, 2))); -extern void warn(const char *err, ...) __attribute__((format (printf, 1, 2))); +extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2))); extern void set_usage_routine(void (*routine)(const char *err) NORETURN); extern void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN); @@ -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);