Portability fixes
This commit is contained in:
parent
983685fde3
commit
2b7079eed2
@ -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)
|
||||
{
|
||||
|
@ -1,3 +1,7 @@
|
||||
#ifdef _MSC_VER
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user