From 780bea6e261cf19cb4bf826de343afcdb362f1b7 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Thu, 29 Sep 2011 16:23:24 +0200 Subject: [PATCH] mingw: Fix printf identifiers --- src/cc-compat.h | 7 +++++++ src/config.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cc-compat.h b/src/cc-compat.h index cce4ca9b1..78dfba7d1 100644 --- a/src/cc-compat.h +++ b/src/cc-compat.h @@ -65,6 +65,13 @@ # define PRIuZ "zu" #endif +/* Define the printf format for 64 bit types */ +#if defined(__MINGW32__) +# define PRIdMAX "I64d" +#else +# define PRIdMAX "lld" +#endif + /* Micosoft Visual C/C++ */ #if defined(_MSC_VER) /* disable "deprecated function" warnings */ diff --git a/src/config.c b/src/config.c index 2b3e53589..852c2e15c 100644 --- a/src/config.c +++ b/src/config.c @@ -167,7 +167,7 @@ int git_config_delete(git_config *cfg, const char *name) int git_config_set_long(git_config *cfg, const char *name, long long value) { char str_value[32]; /* All numbers should fit in here */ - p_snprintf(str_value, sizeof(str_value), "%lld", value); + p_snprintf(str_value, sizeof(str_value), "%" PRIdMAX, value); return git_config_set_string(cfg, name, str_value); }