diff --git a/simgear/nasal/lib.c b/simgear/nasal/lib.c index 440faaa6..1ed3837b 100644 --- a/simgear/nasal/lib.c +++ b/simgear/nasal/lib.c @@ -1,5 +1,6 @@ #include "nasal.h" +#ifndef _MSC_VER // No need to include just for this: static int strlen(char* s) { @@ -7,6 +8,7 @@ static int strlen(char* s) while(*s) s++; return s - s0; } +#endif static naRef size(naContext c, naRef args) { diff --git a/simgear/nasal/mathlib.c b/simgear/nasal/mathlib.c index 07f8ef81..d967ceed 100644 --- a/simgear/nasal/mathlib.c +++ b/simgear/nasal/mathlib.c @@ -1,3 +1,7 @@ +#ifdef _MSC_VER +#define _USE_MATH_DEFINES +#endif + #include #include diff --git a/simgear/nasal/parse.c b/simgear/nasal/parse.c index 22cfed48..a17452c4 100644 --- a/simgear/nasal/parse.c +++ b/simgear/nasal/parse.c @@ -107,7 +107,7 @@ void* naParseAlloc(struct Parser* p, int bytes) p->leftInChunk = sz; } - result = p->chunks[0] + p->chunkSizes[0] - p->leftInChunk; + result = (char *)p->chunks[0] + p->chunkSizes[0] - p->leftInChunk; p->leftInChunk -= bytes; return (void*)result; }