From 948a35e457113fe03f7e8c69875569cda4d2e17c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 29 Apr 2008 20:33:02 -0400 Subject: [PATCH] Visual C++ fixes. --HG-- branch : trunk --- mojoshader.c | 11 ++++++++++- mojoshader_opengl.c | 15 ++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/mojoshader.c b/mojoshader.c index 3120fe4c..8491f35e 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -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 typedef uint8_t uint8; typedef uint32_t uint32; typedef int32_t int32; +#endif #ifdef __GNUC__ #define ISPRINTF(x,y) __attribute__((format (printf, x, y))) diff --git a/mojoshader_opengl.c b/mojoshader_opengl.c index 82e8184c..77c2518f 100644 --- a/mojoshader_opengl.c +++ b/mojoshader_opengl.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -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. + +#ifdef _MSC_VER +#define snprintf _snprintf +typedef unsigned __int8 uint8; +typedef unsigned __int32 uint32; +typedef unsigned __int32 int32; +typedef +#else +#include typedef uint8_t uint8; typedef uint32_t uint32; typedef int32_t int32; +#endif + +#define STATICARRAYLEN(x) ( (sizeof ((x))) / (sizeof ((x)[0])) ) struct MOJOSHADER_glShader {