aboutsummaryrefslogtreecommitdiff
path: root/src/c8asm/common.h
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-02-13 13:02:28 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-02-13 13:11:47 +0100
commit79e6af86ca526d5fb56af6f6ca3da713e3a5e9f9 (patch)
tree752f1c26d1f122dcf58374ac78db109c9578be45 /src/c8asm/common.h
Genesis commit
Diffstat (limited to 'src/c8asm/common.h')
-rw-r--r--src/c8asm/common.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/c8asm/common.h b/src/c8asm/common.h
new file mode 100644
index 0000000..4f905b3
--- /dev/null
+++ b/src/c8asm/common.h
@@ -0,0 +1,16 @@
+#ifndef AHOY_C8ASM_COMMON_H
+#define AHOY_C8ASM_COMMON_H
+
+#include <mbstring.h>
+
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
+
+#define lengthof(a) (sizeof(a) / sizeof(*(a)))
+#define streq(x, y) (!strcmp(x, y))
+
+extern size_t filesize;
+extern const char *filename;
+extern const char8_t *baseptr;
+
+#endif /* !AHOY_C8ASM_COMMON_H */