From 1d2a6f21294f8390b683e4e097cb49210ed832d1 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 26 Mar 2021 23:17:46 +0100 Subject: Added dyn allocator + syscall wrappers + minor fixes. --- lib/include/common.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'lib/include/common.h') diff --git a/lib/include/common.h b/lib/include/common.h index 5ea6050..631c25f 100644 --- a/lib/include/common.h +++ b/lib/include/common.h @@ -3,14 +3,12 @@ #pragma once #include "io.h" -#include "syscall.h" - -#include - -#define ERROR_ON(cond, ...) \ - do { \ - if ((cond)) { \ - efmt(__VA_ARGS__); \ - syscall1(__NR_exit, 1); \ - } \ +#include "syscalls.h" + +#define ERROR_ON(cond, fmt, ...) \ + do { \ + if ((cond)) { \ + efmt("%s:%d " fmt, __FILE__, __LINE__ __VA_OPT__(, ) __VA_ARGS__); \ + _exit(1); \ + } \ } while (0) -- cgit v1.2.3