[DRWTSN32] Fix Clang build. Addendum to bdab437f.

Also use a macro for better code readability.

Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
This commit is contained in:
Stanislav Motylkov 2021-07-25 17:52:33 +03:00
parent bdab437fa4
commit a1ebce3aac
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92

View file

@ -15,30 +15,31 @@ static const char* Exception2Str(DWORD code)
{
switch (code)
{
case EXCEPTION_ACCESS_VIOLATION: return "EXCEPTION_ACCESS_VIOLATION";
case EXCEPTION_DATATYPE_MISALIGNMENT: return "EXCEPTION_DATATYPE_MISALIGNMENT";
case EXCEPTION_BREAKPOINT: return "EXCEPTION_BREAKPOINT";
case EXCEPTION_SINGLE_STEP: return "EXCEPTION_SINGLE_STEP";
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: return "EXCEPTION_ARRAY_BOUNDS_EXCEEDED";
case EXCEPTION_FLT_DENORMAL_OPERAND: return "EXCEPTION_FLT_DENORMAL_OPERAND";
case EXCEPTION_FLT_DIVIDE_BY_ZERO: return "EXCEPTION_FLT_DIVIDE_BY_ZERO";
case EXCEPTION_FLT_INEXACT_RESULT: return "EXCEPTION_FLT_INEXACT_RESULT";
case EXCEPTION_FLT_INVALID_OPERATION: return "EXCEPTION_FLT_INVALID_OPERATION";
case EXCEPTION_FLT_OVERFLOW: return "EXCEPTION_FLT_OVERFLOW";
case EXCEPTION_FLT_STACK_CHECK: return "EXCEPTION_FLT_STACK_CHECK";
case EXCEPTION_FLT_UNDERFLOW: return "EXCEPTION_FLT_UNDERFLOW";
case EXCEPTION_INT_DIVIDE_BY_ZERO: return "EXCEPTION_INT_DIVIDE_BY_ZERO";
case EXCEPTION_INT_OVERFLOW: return "EXCEPTION_INT_OVERFLOW";
case EXCEPTION_PRIV_INSTRUCTION: return "EXCEPTION_PRIV_INSTRUCTION";
case EXCEPTION_IN_PAGE_ERROR: return "EXCEPTION_IN_PAGE_ERROR";
case EXCEPTION_ILLEGAL_INSTRUCTION: return "EXCEPTION_ILLEGAL_INSTRUCTION";
case EXCEPTION_NONCONTINUABLE_EXCEPTION: return "EXCEPTION_NONCONTINUABLE_EXCEPTION";
case EXCEPTION_STACK_OVERFLOW: return "EXCEPTION_STACK_OVERFLOW";
case EXCEPTION_INVALID_DISPOSITION: return "EXCEPTION_INVALID_DISPOSITION";
case EXCEPTION_GUARD_PAGE: return "EXCEPTION_GUARD_PAGE";
case EXCEPTION_INVALID_HANDLE: return "EXCEPTION_INVALID_HANDLE";
case EXCEPTION_WINE_STUB: return "EXCEPTION_WINE_STUB";
case STATUS_ASSERTION_FAILURE: return "STATUS_ASSERTION_FAILURE";
#define EX_TO_STR(name) case (DWORD)(name): return #name
EX_TO_STR(EXCEPTION_ACCESS_VIOLATION);
EX_TO_STR(EXCEPTION_DATATYPE_MISALIGNMENT);
EX_TO_STR(EXCEPTION_BREAKPOINT);
EX_TO_STR(EXCEPTION_SINGLE_STEP);
EX_TO_STR(EXCEPTION_ARRAY_BOUNDS_EXCEEDED);
EX_TO_STR(EXCEPTION_FLT_DENORMAL_OPERAND);
EX_TO_STR(EXCEPTION_FLT_DIVIDE_BY_ZERO);
EX_TO_STR(EXCEPTION_FLT_INEXACT_RESULT);
EX_TO_STR(EXCEPTION_FLT_INVALID_OPERATION);
EX_TO_STR(EXCEPTION_FLT_OVERFLOW);
EX_TO_STR(EXCEPTION_FLT_STACK_CHECK);
EX_TO_STR(EXCEPTION_FLT_UNDERFLOW);
EX_TO_STR(EXCEPTION_INT_DIVIDE_BY_ZERO);
EX_TO_STR(EXCEPTION_INT_OVERFLOW);
EX_TO_STR(EXCEPTION_PRIV_INSTRUCTION);
EX_TO_STR(EXCEPTION_IN_PAGE_ERROR);
EX_TO_STR(EXCEPTION_ILLEGAL_INSTRUCTION);
EX_TO_STR(EXCEPTION_NONCONTINUABLE_EXCEPTION);
EX_TO_STR(EXCEPTION_STACK_OVERFLOW);
EX_TO_STR(EXCEPTION_INVALID_DISPOSITION);
EX_TO_STR(EXCEPTION_GUARD_PAGE);
EX_TO_STR(EXCEPTION_INVALID_HANDLE);
EX_TO_STR(EXCEPTION_WINE_STUB);
EX_TO_STR(STATUS_ASSERTION_FAILURE);
}
return "--";