Skip to content

Commit f90cf2b

Browse files
dschogitster
authored andcommitted
MinGW: GCC >= 4 does not need SNPRINTF_SIZE_CORR anymore
Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Steffen Prohaska <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f9275c6 commit f90cf2b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))
847847
UNRELIABLE_FSTAT = UnfortunatelyYes
848848
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
849849
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch
850-
COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
851850
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
852851
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o
853852
EXTLIBS += -lws2_32

compat/snprintf.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
* number of characters to write without the trailing NUL.
77
*/
88
#ifndef SNPRINTF_SIZE_CORR
9+
#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4
10+
#define SNPRINTF_SIZE_CORR 1
11+
#else
912
#define SNPRINTF_SIZE_CORR 0
1013
#endif
14+
#endif
1115

1216
#undef vsnprintf
1317
int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)

0 commit comments

Comments
 (0)