Code

MinGW: GCC >= 4 does not need SNPRINTF_SIZE_CORR anymore
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 31 May 2009 16:15:15 +0000 (18:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Jun 2009 07:07:21 +0000 (00:07 -0700)
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>
Makefile
compat/snprintf.c

index 0ab1cff30de7b3cc745ce79acca4a3f7cfbd1977..f63eaeae4f6abe034aa6bcdcae970344d4aa7537 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -847,7 +847,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))
        UNRELIABLE_FSTAT = UnfortunatelyYes
        OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
        COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch
-       COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
        COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
        COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o
        EXTLIBS += -lws2_32
index 357e733074ea7c85f880fa577ad65dfb3787fec7..6c0fb056a571b30627e404d7f164de31ed1a8699 100644 (file)
@@ -6,8 +6,12 @@
  * number of characters to write without the trailing NUL.
  */
 #ifndef SNPRINTF_SIZE_CORR
+#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4
+#define SNPRINTF_SIZE_CORR 1
+#else
 #define SNPRINTF_SIZE_CORR 0
 #endif
+#endif
 
 #undef vsnprintf
 int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)