MinGW: GCC >= 4 does not need SNPRINTF_SIZE_CORR anymore
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
May 31, 2009 at 18:15 UTC
f90cf2b9203e81e3a2b70b15480628e9189b7e60
2 files changed
+4
-1
Makefile
-1
@@ -847,7 +847,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))
847
UNRELIABLE_FSTAT = UnfortunatelyYes
848
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
849
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch
850
- COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
850
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
851
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o
852
EXTLIBS += -lws2_32
compat/snprintf.c
+4
@@ -6,8 +6,12 @@
6
* number of characters to write without the trailing NUL.
7
*/
8
#ifndef SNPRINTF_SIZE_CORR
9
+#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4
10
+#define SNPRINTF_SIZE_CORR 1
11
+#else
12
#define SNPRINTF_SIZE_CORR 0
13
#endif
14
+#endif
15
16
#undef vsnprintf
17
int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)