Windows terminal support

This commit is contained in:
2026-02-27 20:30:39 -06:00
parent b64aa67741
commit f68476b4a0
2 changed files with 30 additions and 19 deletions

View File

@@ -17,7 +17,7 @@ void except_raise(const struct Exception *e, const char *file,int line)
#ifdef WIN32
Except_Frame *p;
if (except_index == -1)
if (except_index == TLS_OUT_OF_INDEXES)
except_init();
p = TlsGetValue(except_index);
#else
@@ -46,6 +46,8 @@ void except_raise(const struct Exception *e, const char *file,int line)
#endif
longjmp(p->env, EXCEPT_STATE_RAISED);
}
#ifdef WIN32
_CRTIMP void __cdecl _assert(void *, void *, unsigned);
#undef assert
@@ -61,7 +63,7 @@ void except_init(void) {
assert(cond == TRUE);
}
void Except_push(Except_Frame *fp) {
void except_push(Except_Frame *fp) {
BOOL cond;
fp->prev = TlsGetValue(except_index);
@@ -69,7 +71,7 @@ void Except_push(Except_Frame *fp) {
assert(cond == TRUE);
}
void Except_pop(void) {
void except_pop(void) {
BOOL cond;
Except_Frame *tos = TlsGetValue(except_index);