Kanzi 3.9.10
kzs_error_win32.hpp File Reference

Error (win32). More...

Macros

#define kzsWin32Assert(test)
 Asserts the given test parameter.
 
#define kzsWin32ErrorTest(test, new_error, logMessage)
 Log system error message and return from the function with the given error code, if the test is false.
 
#define kzsWin32ErrorThrow(new_error, logMessage)
 Return from the function with the given error code.
 

Enumerations

enum  KzsErrorAssertType { KZS_ERROR_ASSERT_TYPE_EXIT , KZS_ERROR_ASSERT_TYPE_CRASH }
 This type controls how asserts are handled. More...
 
enum  KzsErrorDebugBreakType { KZS_ERROR_DEBUG_BREAK_TYPE_NEVER , KZS_ERROR_DEBUG_BREAK_TYPE_ALWAYS , KZS_ERROR_DEBUG_BREAK_TYPE_IF_DEBUGGER_PRESENT }
 This type controls whether debug break is called for errors and asserts. More...
 

Functions

void kzsErrorSetAssertType (enum KzsErrorAssertType assertType)
 Sets assert handling type.
 
void kzsErrorSetBreakType (enum KzsErrorDebugBreakType breakType)
 Sets error break type.
 
void kzsWin32ErrorNotify (kzU32 error)
 Logs system error message corresponding to given error number.
 

Detailed Description

Error (win32).

Copyright 2008-2017 by Rightware. All rights reserved.

Macro Definition Documentation

◆ kzsWin32Assert

#define kzsWin32Assert ( test)

Asserts the given test parameter.

If test evaluates to true, nothing happens. Only effective in debug build. Use only when the failing function reports errors using GetLastError(). Extends kzsAssert().

◆ kzsWin32ErrorThrow

#define kzsWin32ErrorThrow ( new_error,
logMessage )

Return from the function with the given error code.

Use only when the failing function reports errors using GetLastError(). Extends kzsErrorThrow().

◆ kzsWin32ErrorTest

#define kzsWin32ErrorTest ( test,
new_error,
logMessage )

Log system error message and return from the function with the given error code, if the test is false.

Otherwise continue. Use only when the failing function reports errors using GetLastError(). Extends kzsErrorTest().

Enumeration Type Documentation

◆ KzsErrorDebugBreakType

This type controls whether debug break is called for errors and asserts.

Enumerator
KZS_ERROR_DEBUG_BREAK_TYPE_NEVER 

Never call debug break.

KZS_ERROR_DEBUG_BREAK_TYPE_ALWAYS 

Always call debug break for errors and asserts.

KZS_ERROR_DEBUG_BREAK_TYPE_IF_DEBUGGER_PRESENT 

Call debug break only if debugger is present for errors and asserts.

◆ KzsErrorAssertType

This type controls how asserts are handled.

Enumerator
KZS_ERROR_ASSERT_TYPE_EXIT 

Call exit(1) to terminate the program.

KZS_ERROR_ASSERT_TYPE_CRASH 

Create an access violation to terminate the program.

Function Documentation

◆ kzsErrorSetBreakType()

void kzsErrorSetBreakType ( enum KzsErrorDebugBreakType breakType)

Sets error break type.

◆ kzsErrorSetAssertType()

void kzsErrorSetAssertType ( enum KzsErrorAssertType assertType)

Sets assert handling type.

◆ kzsWin32ErrorNotify()

void kzsWin32ErrorNotify ( kzU32 error)

Logs system error message corresponding to given error number.