Skip to content

Commit ab03803

Browse files
tsunagitster
authored andcommitted
git-compat-util.h: #undef (v)snprintf before #define them
When we detect that vsnprintf / snprintf are broken, we #define them to an alternative implementation. On OS X, stdio.h already re-define them in `git-compat-util.h'. Signed-off-by: Benoit Sigoure <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f174a25 commit ab03803

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

git-compat-util.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,15 @@ extern FILE *git_fopen(const char*, const char*);
374374
#endif
375375

376376
#ifdef SNPRINTF_RETURNS_BOGUS
377+
#ifdef snprintf
378+
#undef snprintf
379+
#endif
377380
#define snprintf git_snprintf
378381
extern int git_snprintf(char *str, size_t maxsize,
379382
const char *format, ...);
383+
#ifdef vsnprintf
384+
#undef vsnprintf
385+
#endif
380386
#define vsnprintf git_vsnprintf
381387
extern int git_vsnprintf(char *str, size_t maxsize,
382388
const char *format, va_list ap);

0 commit comments

Comments
 (0)