Visual C++ fixes. trunk
authorRyan C. Gordon <icculus@icculus.org>
Tue, 29 Apr 2008 20:33:02 -0400
branchtrunk
changeset 250 b75c08291021
parent 249 7f928921766c
child 251 290378a53579
Visual C++ fixes.
mojoshader.c
mojoshader_opengl.c
--- a/mojoshader.c	Tue Apr 29 05:44:40 2008 -0400
+++ b/mojoshader.c	Tue Apr 29 20:33:02 2008 -0400
@@ -20,7 +20,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <stdint.h>
 #include <stdarg.h>
 #include <assert.h>
 
@@ -52,9 +51,19 @@
 // Get basic wankery out of the way here...
 
 typedef unsigned int uint;  // this is a printf() helper. don't use for code.
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+typedef unsigned __int8 uint8;
+typedef unsigned __int32 uint32;
+typedef unsigned __int32 int32;
+typedef
+#else
+#include <stdint.h>
 typedef uint8_t uint8;
 typedef uint32_t uint32;
 typedef int32_t int32;
+#endif
 
 #ifdef __GNUC__
 #define ISPRINTF(x,y) __attribute__((format (printf, x, y)))
--- a/mojoshader_opengl.c	Tue Apr 29 05:44:40 2008 -0400
+++ b/mojoshader_opengl.c	Tue Apr 29 20:33:02 2008 -0400
@@ -10,7 +10,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <stdint.h>
 #include <stdarg.h>
 #include <assert.h>
 
@@ -21,12 +20,22 @@
 
 // Get basic wankery out of the way here...
 
-#define STATICARRAYLEN(x) ( (sizeof ((x))) / (sizeof ((x)[0])) )
+typedef unsigned int uint;  // this is a printf() helper. don't use for code.
 
-typedef unsigned int uint;  // this is a printf() helper. don't use for code.
+#ifdef _MSC_VER
+#define snprintf _snprintf
+typedef unsigned __int8 uint8;
+typedef unsigned __int32 uint32;
+typedef unsigned __int32 int32;
+typedef
+#else
+#include <stdint.h>
 typedef uint8_t uint8;
 typedef uint32_t uint32;
 typedef int32_t int32;
+#endif
+
+#define STATICARRAYLEN(x) ( (sizeof ((x))) / (sizeof ((x)[0])) )
 
 struct MOJOSHADER_glShader
 {