aboutsummaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/common.h b/src/common.h
index 03b103f..1d4c70b 100644
--- a/src/common.h
+++ b/src/common.h
@@ -1,6 +1,7 @@
#ifndef COMMON_H
#define COMMON_H
+#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
@@ -26,9 +27,11 @@
#define USAGE_STR "Usage: " NAME
-// inspired by Zigs unreachable
-#include <assert.h>
-#define unreachable assert(0 && "unreachable code reached")
+#ifdef DEBUG
+#define unreachable printf("unreachable code reached\n" __FILE__ ":L%i\n", __LINE__); exit(0);
+#else
+#define unreachable
+#endif
struct MemoryStruct {
uint8_t* memory;