glsl2: Include imports.h to get snprintf wrapper for MSVC
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 13 Aug 2010 00:57:07 +0000 (17:57 -0700)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 23 Aug 2010 19:55:50 +0000 (20:55 +0100)
Signed-off-by: José Fonseca <jfonseca@vmware.com>
src/glsl/glsl_types.cpp
src/glsl/ir_explog_to_explog2.cpp
src/mesa/main/imports.h

index 8e80cf99e96443d12f3688573f3fb70ad051c5b4..518abc959d866037c5c47318e7d08af269519b72 100644 (file)
@@ -29,6 +29,7 @@
 #include "glsl_types.h"
 #include "builtin_types.h"
 extern "C" {
+#include "main/imports.h"
 #include "program/hash_table.h"
 }
 
index 4fe1daaee916dd5a0a23a2358d2f049c50f64163..9bf827108124312e9f72a470a29de525f103d332 100644 (file)
@@ -29,7 +29,7 @@
  * and log2 operations.
  */
 
-#include <math.h>
+#include "main/imports.h"
 #include "ir.h"
 #include "glsl_types.h"
 
index 22ac26e15e9d989121bb5ed9d6d8f75c6c6b3a37..6c2ef52d35b3a5e259ba02b520b15045b08d4a69 100644 (file)
@@ -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