Workaround for MinGW headers lacking some exception definitions.

This commit is contained in:
Mike Pall 2016-05-20 19:45:38 +02:00
parent 4fe400cfd5
commit d4f3b1136b

View File

@ -439,7 +439,7 @@ VOID RtlUnwindEx_FIXED(PVOID,PVOID,PVOID,PVOID,PVOID,PVOID) asm("RtlUnwindEx");
#define LJ_EXCODE_ERRCODE(cl) ((int)((cl) & 0xff)) #define LJ_EXCODE_ERRCODE(cl) ((int)((cl) & 0xff))
/* Windows exception handler for interpreter frame. */ /* Windows exception handler for interpreter frame. */
LJ_FUNCA EXCEPTION_DISPOSITION lj_err_unwind_win(EXCEPTION_RECORD *rec, LJ_FUNCA int lj_err_unwind_win(EXCEPTION_RECORD *rec,
void *f, CONTEXT *ctx, UndocumentedDispatcherContext *dispatch) void *f, CONTEXT *ctx, UndocumentedDispatcherContext *dispatch)
{ {
#if LJ_TARGET_X64 #if LJ_TARGET_X64
@ -464,7 +464,7 @@ LJ_FUNCA EXCEPTION_DISPOSITION lj_err_unwind_win(EXCEPTION_RECORD *rec,
setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP)); setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP));
} else if (!LJ_EXCODE_CHECK(rec->ExceptionCode)) { } else if (!LJ_EXCODE_CHECK(rec->ExceptionCode)) {
/* Don't catch access violations etc. */ /* Don't catch access violations etc. */
return ExceptionContinueSearch; return 1; /* ExceptionContinueSearch */
} }
#if LJ_TARGET_X64 #if LJ_TARGET_X64
/* Unwind the stack and call all handlers for all lower C frames /* Unwind the stack and call all handlers for all lower C frames
@ -490,7 +490,7 @@ LJ_FUNCA EXCEPTION_DISPOSITION lj_err_unwind_win(EXCEPTION_RECORD *rec,
#endif #endif
} }
} }
return ExceptionContinueSearch; return 1; /* ExceptionContinueSearch */
} }
/* Raise Windows exception. */ /* Raise Windows exception. */