From: ehofman Date: Wed, 26 Nov 2003 14:39:46 +0000 (+0000) Subject: Portability fixes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2b7079eed24448e15f7200c96efc23f22a2e4db9;p=simgear.git Portability fixes --- 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; }