aboutsummaryrefslogtreecommitdiff
path: root/lib/include/common.h
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2021-04-28 23:08:45 +0200
committerjohannst <johannes.stoelp@gmail.com>2021-04-28 23:08:45 +0200
commitd367355eb4c3569d422034b69737d8dc7022e13e (patch)
treef9f6768228235f4712466d65edeb0b745d904833 /lib/include/common.h
parentcf97ecd5b52c2f7a8953fd1674742d46fd15418a (diff)
parentfc137e7d0263a0fe908ca1a150e34a9c8b9902d4 (diff)
downloaddynld-d367355eb4c3569d422034b69737d8dc7022e13e.tar.gz
dynld-d367355eb4c3569d422034b69737d8dc7022e13e.zip
Merge branch 'dev04'
Diffstat (limited to 'lib/include/common.h')
-rw-r--r--lib/include/common.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/include/common.h b/lib/include/common.h
index 5ea6050..d006d71 100644
--- a/lib/include/common.h
+++ b/lib/include/common.h
@@ -3,14 +3,17 @@
#pragma once
#include "io.h"
-#include "syscall.h"
+#include "syscalls.h"
-#include <asm/unistd.h>
-
-#define ERROR_ON(cond, ...) \
- do { \
- if ((cond)) { \
- efmt(__VA_ARGS__); \
- syscall1(__NR_exit, 1); \
- } \
+#define ERROR_ON(cond, fmt, ...) \
+ do { \
+ if ((cond)) { \
+ efmt("%s:%d " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__); \
+ _exit(1); \
+ } \
} while (0)
+
+
+void* memset(void* s, int c, size_t n);
+void* memcpy(void* d, const void* s, size_t n);
+