diff options
author | johannst <johannes.stoelp@gmail.com> | 2021-03-26 23:17:46 +0100 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2021-03-26 23:17:46 +0100 |
commit | 1d2a6f21294f8390b683e4e097cb49210ed832d1 (patch) | |
tree | 19f6854c3e1fa6a82ec4ed4bb57b2d3dadf979b8 /lib/include/common.h | |
parent | cf97ecd5b52c2f7a8953fd1674742d46fd15418a (diff) | |
download | dynld-1d2a6f21294f8390b683e4e097cb49210ed832d1.tar.gz dynld-1d2a6f21294f8390b683e4e097cb49210ed832d1.zip |
Added dyn allocator + syscall wrappers + minor fixes.
Diffstat (limited to 'lib/include/common.h')
-rw-r--r-- | lib/include/common.h | 18 |
1 files changed, 8 insertions, 10 deletions
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 <asm/unistd.h> - -#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) |