From 5346b0127e5c1cbeac897d0deeaaf8ef08258994 Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 17 Mar 2021 16:16:17 +0000 Subject: [PATCH] added helper functions/macros --- src/dev.h | 24 ++++++++++++++++++++++++ src/state.cpp | 7 +++++++ 2 files changed, 31 insertions(+) create mode 100644 src/dev.h diff --git a/src/dev.h b/src/dev.h new file mode 100644 index 0000000..fe997d5 --- /dev/null +++ b/src/dev.h @@ -0,0 +1,24 @@ +#ifndef _TODO_H +#define _TODO_H + + +#ifdef __cplusplus +#include +[[noreturn]] +#else +#include + +__attribute__((noreturn)) +#endif +inline static void _dev__unimplemented(const char* msg) +{ + fputs("unimplemented", stderr); + if(msg) fputs(msg, stderr); + fputc('\n', stderr); + + abort(); +} + +#define TODO(msg) _dev__unimplemented(": TODO: " msg) + +#endif /* _TODO_H */ diff --git a/src/state.cpp b/src/state.cpp index 882aaa6..e86c7da 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -1,6 +1,13 @@ #include +#include "dev.h" + +void _sm_pop_stack(sm_state* state) +{ + TODO("Free the current stack frame in `state` and replace it with the previous one"); +} sm_yield _sm_noop(sm_state*) { return (sm_yield)nullptr; } +