diff --git a/CMakeLists.txt b/CMakeLists.txt index eaf6b50..15dfb03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(ink C) set(CMAKE_C_STANDARD 90) -add_library(ink lib.c ink.h) +add_library(ink lib.c include/ink.h) # Uncomment to disable the redundant arithmetic # add_definitions(-DNOEXTRAARITHMETIC) @@ -16,6 +16,7 @@ add_library(ink lib.c ink.h) add_executable(ink_exe main.c) target_link_libraries(ink_exe PUBLIC ink) +target_include_directories(ink PUBLIC include) # Benchmark is broken since the addition to coroutines # add_executable(ink_bench bench.c) diff --git a/bench.c b/bench.c index d1753db..ba64d3e 100644 --- a/bench.c +++ b/bench.c @@ -1,4 +1,4 @@ -#include "ink.h" +#include "include/ink.h" #include #include #include diff --git a/ink.h b/include/ink.h similarity index 100% rename from ink.h rename to include/ink.h diff --git a/lib.c b/lib.c index cfd8542..519c968 100644 --- a/lib.c +++ b/lib.c @@ -1,4 +1,4 @@ -#include "ink.h" +#include "include/ink.h" #ifndef NOSTDLIB #include #include @@ -594,6 +594,7 @@ static int ink_parse(struct context* pContext, struct elem* executable_buffer, i #define FUNCTION_BUFFER 256 struct label labels[LABEL_BUFFER]; struct elem function_buffer[FUNCTION_BUFFER]; + /* TODO: add checks for overflows in these arrays */ currentRoutine = pContext->routines + pContext->routine_current; function_buffer_top = 0; function_name = -1;