From 3d8ce4e7d82c780bb91b66f70986561b73a28115 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 11 Nov 2022 17:31:45 +0000 Subject: [PATCH] Trying to fix time and platforms --- repl/lib_timer.c | 25 +------------------------ source/toy_common.h | 9 +++++++++ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/repl/lib_timer.c b/repl/lib_timer.c index 010d643..240e4cc 100644 --- a/repl/lib_timer.c +++ b/repl/lib_timer.c @@ -3,30 +3,7 @@ #include "memory.h" #include -#include -#include - -/* -//using time.h -var timer: opaque = startTimer(); -var diff: opaque = timer.stopTimer(); - -... - -var timer = createTimer(seconds, microseconds); -print timer.getTimerSeconds(); -print timer.getTimerMicroseconds(); - -... - -var diff: opaque = timer.compareTimers(rhs); //expects another timer - -... - -print timer.timerToString(); //string representation of the timer - -timer.destroyTimer(); //needed to free the memory -*/ +#include "toy_common.h" //god damn it static struct timeval* diff(struct timeval* lhs, struct timeval* rhs) { diff --git a/source/toy_common.h b/source/toy_common.h index 6cac89b..30eea44 100644 --- a/source/toy_common.h +++ b/source/toy_common.h @@ -12,8 +12,17 @@ //platform exports/imports #if defined(__linux__) #define TOY_API extern +#include + +#elif defined(_WIN32) || defined(WIN32) +#define TOY_API +#include +#include + #else #define TOY_API +#include + #endif #ifndef TOY_EXPORT