kzs_error_win32.hpp File Reference

Error (win32). More...

Macros

#define kzsWin32Assert(test)
 Asserts the given test parameter. More...
 
#define kzsWin32ErrorThrow(new_error, logMessage)
 Return from the function with the given error code. More...
 
#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. More...
 

Enumerations

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...
 
enum  KzsErrorAssertType { KZS_ERROR_ASSERT_TYPE_EXIT, KZS_ERROR_ASSERT_TYPE_CRASH }
 This type controls how asserts are handled. More...
 

Functions

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

Detailed Description

Error (win32).

Copyright 2008-2017 by Rightware. All rights reserved.

Macro Definition Documentation

#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().

#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().

#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

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.

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

KANZI_API void kzsErrorSetBreakType ( enum KzsErrorDebugBreakType  breakType)

Sets error break type.

KANZI_API void kzsErrorSetAssertType ( enum KzsErrorAssertType  assertType)

Sets assert handling type.

KANZI_API void kzsWin32ErrorNotify ( kzU32  error)

Logs system error message corresponding to given error number.