summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordzaima <dzaimagit@gmail.com>2024-04-04 02:10:19 +0300
committerdzaima <dzaimagit@gmail.com>2024-04-04 02:35:02 +0300
commitfd317ddce39cdd0a75bbff25daac14005efe8ab9 (patch)
tree5bb24c01f222dce24de2b12cde251311f7f3b949
parent74f3b5a0124f51992747427c9072a89562ef572c (diff)
move heapverify CATCH_ERRORS change to build.bqn
-rwxr-xr-xbuild/src/build.bqn2
-rw-r--r--src/h.h6
2 files changed, 2 insertions, 6 deletions
diff --git a/build/src/build.bqn b/build/src/build.bqn
index e798e86b..2b0b0dc6 100755
--- a/build/src/build.bqn
+++ b/build/src/build.bqn
@@ -330,7 +330,7 @@ po ← { # parsed options
args∾↩ ( o3) / ⟨"-O3"⟩
args∾↩ ( debug) / ⟨"-DDEBUG"⟩
args∾↩ ( rtverify) / ⟨"-DRT_VERIFY"⟩
- args∾↩ ( heapverify) / ⟨"-DHEAP_VERIFY"⟩
+ args∾↩ ( heapverify) / ⟨"-DHEAP_VERIFY", "-DCATCH_ERRORS=0"⟩
args∾↩ ( exportSymbols) / ⟨"-DCBQN_EXPORT"⟩
args∾↩ ( ¬pie) / ⟨"-fno-pie"⟩
args∾↩ (pie ∧ ¬sharedLib) / ⟨"-fPIE"⟩
diff --git a/src/h.h b/src/h.h
index fa96059f..4a3322e2 100644
--- a/src/h.h
+++ b/src/h.h
@@ -46,10 +46,6 @@
#if CATCH_ERRORS
#include <setjmp.h>
#endif
-#if HEAP_VERIFY
- #undef CATCH_ERRORS
- #define CATCH_ERRORS 0
-#endif
#define RT_LEN 64
@@ -398,7 +394,7 @@ NOINLINE NORETURN void thrM(char* s);
NOINLINE NORETURN void thrF(char* s, ...);
NOINLINE NORETURN void thrOOM(void);
#if CATCH_ERRORS
-jmp_buf* prepareCatch(void);
+ jmp_buf* prepareCatch(void);
#define CATCH setjmp(*prepareCatch()) // use as `if (CATCH) { /*handle error*/ freeThrown(); return; } /*potentially erroring thing*/ popCatch(); /*no errors yay*/`
void popCatch(void); // note: popCatch() must always be called if no error is thrown, so no returns before it!
#else