From: Ian Romanick Date: Fri, 13 Aug 2010 00:57:07 +0000 (-0700) Subject: glsl2: Include imports.h to get snprintf wrapper for MSVC X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6dad5a4e8d5c4ea90bb9342e329defb9c8eb2092;p=mesa.git glsl2: Include imports.h to get snprintf wrapper for MSVC Signed-off-by: José Fonseca --- diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index 8e80cf99e96..518abc959d8 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -29,6 +29,7 @@ #include "glsl_types.h" #include "builtin_types.h" extern "C" { +#include "main/imports.h" #include "program/hash_table.h" } diff --git a/src/glsl/ir_explog_to_explog2.cpp b/src/glsl/ir_explog_to_explog2.cpp index 4fe1daaee91..9bf82710812 100644 --- a/src/glsl/ir_explog_to_explog2.cpp +++ b/src/glsl/ir_explog_to_explog2.cpp @@ -29,7 +29,7 @@ * and log2 operations. */ -#include +#include "main/imports.h" #include "ir.h" #include "glsl_types.h" diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 22ac26e15e9..6c2ef52d35b 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -578,6 +578,12 @@ _mesa_error( __GLcontext *ctx, GLenum error, const char *fmtString, ... ); extern void _mesa_debug( const __GLcontext *ctx, const char *fmtString, ... ); + +#if defined(_MSC_VER) && !defined(snprintf) +#define snprintf _snprintf +#endif + + #ifdef __cplusplus } #endif