Portability fixes

This commit is contained in:
ehofman 2003-11-26 14:39:46 +00:00
parent 983685fde3
commit 2b7079eed2
3 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#include "nasal.h"
#ifndef _MSC_VER
// No need to include <string.h> 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)
{

View File

@ -1,3 +1,7 @@
#ifdef _MSC_VER
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#include <string.h>

View File

@ -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;
}