Module: Mesa
Branch: master
Commit: 73f1e33d34b2044f2252a73e0fdd827d39724505
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=73f1e33d34b2044f2252a73e0fdd827d39724505

Author: Brian Paul <bri...@vmware.com>
Date:   Fri Apr 13 09:32:31 2018 -0600

mesa: remove snprintf macro in imports.h to fix MSVC build

snprintf is a macro in the MSVC stdio.h header and we needed to
include that header before imports.h where we also defined an
snprintf macro.  Otherwise, the MSVC build would fail.  The recent
mtypes.h removal patches seems to have exposed this issue.

This patch simply removes our snprintf macro and replaces one use
of it in teximage.c with _mesa_snprintf().  There are other calls
to snprintf() in DRI drivers, but none of them are built on Windows.

Reviewed-by: Charmaine Lee <charmai...@vmware.com>
Reviewed-by: Neha Bhende <bhen...@vmware.com>

---

 src/mesa/main/imports.h  | 4 ----
 src/mesa/main/teximage.c | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 72ce8783dd..a761f01851 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -339,10 +339,6 @@ extern int
 _mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list arg);
 
 
-#if defined(_MSC_VER) && !defined(snprintf)
-#define snprintf _snprintf
-#endif
-
 #if defined(_WIN32) && !defined(strtok_r)
 #define strtok_r strtok_s
 #endif
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 8d5f8aa545..5284e60b20 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1911,7 +1911,7 @@ texture_error_check( struct gl_context *ctx,
     * requires GL_OES_texture_float) are filtered elsewhere.
     */
    char bufCallerName[20];
-   snprintf(bufCallerName, 20, "glTexImage%dD", dimensions);
+   _mesa_snprintf(bufCallerName, 20, "glTexImage%dD", dimensions);
    if (_mesa_is_gles(ctx) &&
        texture_format_error_check_gles(ctx, format, type,
                                        internalFormat, bufCallerName)) {

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to