From f57a440623c18a84fb523e90f8d96b3ed707a82d Mon Sep 17 00:00:00 2001 From: PreacherDHM Date: Wed, 29 Jan 2025 19:09:58 +0000 Subject: [PATCH] fixed c implemntation --- includes/tart.h | 6 ++++++ source/term.c | 8 +++++++- testing/CMakeLists.txt | 4 ++-- testing/main.cpp | 9 +++++---- testing/test_tart.cpp | 1 - testing/test_tart.h | 4 ++-- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/includes/tart.h b/includes/tart.h index 618e798..dc19eb6 100644 --- a/includes/tart.h +++ b/includes/tart.h @@ -1,5 +1,8 @@ #ifndef TART_H #define TART_H +#ifdef __cplusplus +extern "C" { +#endif // #========================================================================# // | PreacherDHM:TART // | @@ -86,4 +89,7 @@ struct tart_buffer* tart_get_buffer(struct tart_window*, tart_byte); struct tart_cell* tart_get_cell(struct tart_buffer*, int); struct tart_cell tart_set_cell(struct tart_buffer*, struct tart_cell,int); +#ifdef __cplusplus +} +#endif #endif diff --git a/source/term.c b/source/term.c index 6c1e5ee..c82e81c 100644 --- a/source/term.c +++ b/source/term.c @@ -2,7 +2,7 @@ #include "../includes/tart.h" -// windows only +#ifdef _WIN64 #include struct tart_vec2 term_current_size() { struct tart_vec2 ret; @@ -19,3 +19,9 @@ struct tart_vec2 term_current_size() { return ret; } +#endif + +struct tart_vec2 term_current_size() { + struct tart_vec2 ret = {50,50}; + return ret; +} diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index 8a886ae..b31f23a 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -3,10 +3,10 @@ set( CMAKE_CXX_STANDARD 11) set( CMAKE_CXX_STANDARD_REQUIRED ON) set( SOURCES main.cpp - test_tart.cpp + #test_tart.cpp ) add_executable(${PROJECT_NAME} ${SOURCES} ) -target_link_libraries(${PROJECT_NAME} TartLib PickleLib) +target_link_libraries(${PROJECT_NAME} TartLib)# PickleLib) add_test(${PROJECT_NAME} "${CMAKE_SOURCE_DIR}/bin/testing.exe") diff --git a/testing/main.cpp b/testing/main.cpp index c0de5b5..b4dc40d 100644 --- a/testing/main.cpp +++ b/testing/main.cpp @@ -1,7 +1,8 @@ #include "test_tart.h" -#include +//#include int main (int argc, char *argv[]) { - INSTALLSHELF; - tart_run(&__pickle_shelf__); - return PICKLESHELF; +// INSTALLSHELF; + tart_create_cell('t', '1', (struct tart_rgb){0,0,0}, (struct tart_rgb){0,0,0}); + //tart_run(&__pickle_shelf__); + return 0;//PICKLESHELF; } diff --git a/testing/test_tart.cpp b/testing/test_tart.cpp index 5e0fe70..683e2e2 100644 --- a/testing/test_tart.cpp +++ b/testing/test_tart.cpp @@ -1,5 +1,4 @@ #include "test_tart.h" -#include "../includes/tart.h" #include "Pickler.h" bool rgb_test(struct tart_rgb* lhs, struct tart_rgb* rhs) { if(lhs->r != rhs->r) {return false;} diff --git a/testing/test_tart.h b/testing/test_tart.h index ccbf5f8..7dd8e31 100644 --- a/testing/test_tart.h +++ b/testing/test_tart.h @@ -1,5 +1,5 @@ -#include "../includes/tart.h" -#include +#include +//#include bool rgb_test(struct tart_rgb* lhs, struct tart_rgb* rhs); bool vec2_test(struct tart_vec2* lhs, struct tart_vec2* rhs);