diff --git a/.vscode/settings.json b/.vscode/settings.json index 686cb6e..1faeb6b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -30,7 +30,10 @@ "alloca.h": "c", "bot.h": "c", "string_view": "c", - "lconfig.h": "c" + "lconfig.h": "c", + "inttypes.h": "c", + "time.h": "c", + "features.h": "c" }, "cSpell.words": [ "cnc's", diff --git a/lib/include/laika.h b/lib/include/laika.h index 7eef660..9018989 100644 --- a/lib/include/laika.h +++ b/lib/include/laika.h @@ -13,9 +13,15 @@ #define ARRAY_START 4 #ifdef DEBUG -#define LAIKA_DEBUG(...) printf("[~] " __VA_ARGS__); fflush(stdout); +# define LAIKA_DEBUG(...) printf("[~] " __VA_ARGS__); fflush(stdout); #else -#define LAIKA_DEBUG(...) ((void)0) /* no op */ +# define LAIKA_DEBUG(...) ((void)0) /* no op */ +#endif + +#ifndef _WIN32 +# define LAIKA_FORCEINLINE __attribute__((always_inline)) inline +#else +# define LAIKA_FORCEINLINE __forceinline #endif #endif \ No newline at end of file diff --git a/lib/include/lbox.h b/lib/include/lbox.h index 940d2c1..d763a43 100644 --- a/lib/include/lbox.h +++ b/lib/include/lbox.h @@ -3,6 +3,7 @@ #include +#include "laika.h" #include "lvm.h" /* Laika Box: @@ -22,12 +23,12 @@ struct sLaikaB_box { struct sLaikaV_vm vm; }; -inline void laikaB_unlock(struct sLaikaB_box *box) { +LAIKA_FORCEINLINE void laikaB_unlock(struct sLaikaB_box *box) { } /* safely free's allocated buffer using libsodium's api for clearing sensitive data from memory */ -inline void laikaB_lock(struct sLaikaB_box *box) { +LAIKA_FORCEINLINE void laikaB_lock(struct sLaikaB_box *box) { } diff --git a/lib/include/lvm.h b/lib/include/lvm.h index 03023ac..9c3ba16 100644 --- a/lib/include/lvm.h +++ b/lib/include/lvm.h @@ -9,6 +9,7 @@ #include +#include "laika.h" #include "lerror.h" #define LAIKA_VM_CODESIZE 512 @@ -58,7 +59,7 @@ enum { OP_TESTJMP, /* if stk_indx[uint8_t] != 0, pc += [uint8_t] */ }; -inline void laikaV_execute(struct sLaikaV_vm *vm) { +LAIKA_FORCEINLINE void laikaV_execute(struct sLaikaV_vm *vm) { #define READBYTE (vm->code[vm->pc++]) #define BINOP(x) { \