forked from Mirror/wren
Fixes to make GCC happier.
This commit is contained in:
4
Makefile
4
Makefile
@ -27,7 +27,7 @@ debug: prep wrend
|
||||
|
||||
# Debug command-line interpreter.
|
||||
wrend: $(DEBUG_OBJECTS)
|
||||
$(CC) $(CFLAGS) $(DEBUG_CFLAGS) -Iinclude -o wrend $^
|
||||
$(CC) $(CFLAGS) $(DEBUG_CFLAGS) -Iinclude -lm -o wrend $^
|
||||
|
||||
# Debug object files.
|
||||
build/debug/%.o: src/%.c include/wren.h $(HEADERS)
|
||||
@ -38,7 +38,7 @@ release: prep wren
|
||||
|
||||
# Release command-line interpreter.
|
||||
wren: $(RELEASE_OBJECTS)
|
||||
$(CC) $(CFLAGS) $(RELEASE_CFLAGS) -Iinclude -o wren $^
|
||||
$(CC) $(CFLAGS) $(RELEASE_CFLAGS) -Iinclude -lm -o wren $^
|
||||
|
||||
# Release object files.
|
||||
build/release/%.o: src/%.c include/wren.h $(HEADERS)
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
#define _GNU_SOURCE // Makes getline() available in GCC.
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
@ -56,6 +58,10 @@ static int runFile(WrenVM* vm, const char* path)
|
||||
case WREN_RESULT_SUCCESS: result = 0; break;
|
||||
case WREN_RESULT_COMPILE_ERROR: result = 65; break; // EX_DATAERR.
|
||||
case WREN_RESULT_RUNTIME_ERROR: result = 70; break; // EX_SOFTWARE.
|
||||
default:
|
||||
// Unreachable.
|
||||
result = 255;
|
||||
break;
|
||||
}
|
||||
|
||||
wrenFreeVM(vm);
|
||||
|
||||
@ -2248,6 +2248,9 @@ static int getNumArguments(const uint8_t* bytecode, const Value* constants,
|
||||
// There are two bytes for the constant, then two for each upvalue.
|
||||
return 2 + (loadedFn->numUpvalues * 2);
|
||||
}
|
||||
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ ObjFiber* wrenNewFiber(WrenVM* vm, Obj* fn)
|
||||
|
||||
ObjFn* wrenNewFunction(WrenVM* vm, Value* constants, int numConstants,
|
||||
int numUpvalues, int numParams,
|
||||
u_int8_t* bytecode, int bytecodeLength,
|
||||
uint8_t* bytecode, int bytecodeLength,
|
||||
ObjString* debugSourcePath,
|
||||
const char* debugName, int debugNameLength,
|
||||
int* sourceLines)
|
||||
|
||||
@ -564,7 +564,7 @@ ObjFiber* wrenNewFiber(WrenVM* vm, Obj* fn);
|
||||
// copy [constants] into its own array.
|
||||
ObjFn* wrenNewFunction(WrenVM* vm, Value* constants, int numConstants,
|
||||
int numUpvalues, int numParams,
|
||||
u_int8_t* bytecode, int bytecodeLength,
|
||||
uint8_t* bytecode, int bytecodeLength,
|
||||
ObjString* debugSourcePath,
|
||||
const char* debugName, int debugNameLength,
|
||||
int* sourceLines);
|
||||
|
||||
Reference in New Issue
Block a user