Skip to content

Commit f8d95a3

Browse files
hickfordgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fd21e6e commit f8d95a3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contrib/credential/wincred/git-credential-wincred.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
1414

15+
#ifndef _MSC_VER
1516
__attribute__((format (printf, 1, 2)))
17+
#endif
1618
static void die(const char *err, ...)
1719
{
1820
char msg[4096];

0 commit comments

Comments
 (0)