Added MSVC build support, likely broke tests

This commit is contained in:
2023-02-11 00:49:21 +00:00
parent be4cbf1ad6
commit 457014d577
18 changed files with 432 additions and 148 deletions

View File

@@ -3,7 +3,6 @@
#include "toy_memory.h"
#include <time.h>
#include <sys/time.h>
static int nativeClock(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments) {
//no arguments
@@ -18,7 +17,7 @@ static int nativeClock(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments
char* timestr = asctime(timeinfo);
//push to the stack
int len = strlen(timestr) - 1; //-1 for the newline
size_t len = strlen(timestr) - 1; //-1 for the newline
Toy_Literal timeLiteral = TOY_TO_STRING_LITERAL(Toy_createRefStringLength(timestr, len));
//push to the stack
@@ -32,7 +31,7 @@ static int nativeClock(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments
//call the hook
typedef struct Natives {
char* name;
const char* name;
Toy_NativeFn fn;
} Natives;