util: Only use open coded snprintf for MSVC.
authorVinson Lee <vlee@freedesktop.org>
Thu, 15 Nov 2012 06:25:05 +0000 (22:25 -0800)
committerVinson Lee <vlee@freedesktop.org>
Sat, 17 Nov 2012 07:18:23 +0000 (23:18 -0800)
MinGW has snprintf.

The patch fixes these warnings with the MinGW SCons build.

src/gallium/auxiliary/util/u_snprintf.c:459:1: warning: no previous prototype for ‘util_vsnprintf’ [-Wmissing-prototypes]
src/gallium/auxiliary/util/u_snprintf.c:1436:1: warning: no previous prototype for ‘util_snprintf’ [-Wmissing-prototypes]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/util/u_snprintf.c
src/gallium/auxiliary/util/u_string.h

index e16f103e3f50f0f78e33bdafc92b8a254a03511c..a24b6ff38db6399b6b629a4af9ff0a71ccd90348 100644 (file)
 #if HAVE_CONFIG_H
 #include <config.h>
 #else
-#ifdef _WIN32
+#ifdef _MSC_VER
 #define vsnprintf util_vsnprintf
 #define snprintf util_snprintf
 #define HAVE_VSNPRINTF 0
index 15630ad0791bf0947903267e9639bebe08bad96d..fca73ffc7181ffbef5b6225cb7180bd717b10d14 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef U_STRING_H_
 #define U_STRING_H_
 
-#if !defined(_WIN32) && !defined(XF86_LIBC_H)
+#if !defined(_MSC_VER) && !defined(XF86_LIBC_H)
 #include <stdio.h>
 #endif
 #include <stddef.h>
@@ -64,7 +64,7 @@ util_strchrnul(const char *s, char c)
 
 #endif
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 
 int util_vsnprintf(char *, size_t, const char *, va_list);
 int util_snprintf(char *str, size_t size, const char *format, ...);