Git fork

contrib/credential: fix compilation of wincred helper with MSVC

The git-credential-wincred helper does not compile on Windows with
Microsoft Visual Studio because of our use of `__attribute__()`, which
its compiler doesn't support. While the rest of our codebase would know
to handle this because we redefine the macro in "compat/msvc.h", this
stub isn't available here because we don't include "git-compat-util.h"
in the first place.

Fix the issue by making the attribute depend on the `_MSC_VER`
preprocessor macro.

Signed-off-by: M Hickford <mirth.hickford@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

M Hickford and committed by
Junio C Hamano
f8d95a32 fd21e6e4

+2
+2
contrib/credential/wincred/git-credential-wincred.c
··· 12 12 13 13 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) 14 14 15 + #ifndef _MSC_VER 15 16 __attribute__((format (printf, 1, 2))) 17 + #endif 16 18 static void die(const char *err, ...) 17 19 { 18 20 char msg[4096];