SDK_*ASSERT, SDK_ASSERT*


C Specification

#include <nitro/misc.h>

SDK_ASSERT(exp); 
SDK_ASSERTMSG(exp, fmt, ...); 
SDK_NULL_ASSERT(exp); 
SDK_MINMAX_ASSERT(exp, min, max); 
SDK_MIN_ASSERT(exp, min); 
SDK_MAX_ASSERT(exp, max); 
SDK_ALIGN4_ASSERT(exp); 
SDK_ALIGN2_ASSERT(exp);

Description

This macro examines a condition, and outputs a character string if the condition is not fulfilled. After that, it forces the application to terminate.

The SDK_ASSERTMSG macro allows a variable number of arguments according to the format character string fmt.

Each macro function displays an assert message in the following cases:

  1. SDK_ASSERT( exp ) is displayed when the value of evaluation expression exp is false (when exp is not formed).
  2. SDK_ASSERTMSG( exp, fmt, ... ) is displayed when the value of evaluation expression exp is false (when exp is not formed).
  3. SDK_NULL_ASSERT( exp ) is displayed when the value of evaluation expression exp is not equal to NULL.
  4. SDK_MINMAX_ASSERT( exp, min, max ) is displayed when the value of evaluation expression exp is less than min or greater than max.
  5. SDK_MIN_ASSERT( exp, min ) is displayed when the value of evaluation expression exp is less than min.
  6. SDK_MAX_ASSERT( exp, max ) is displayed when the value of evaluation expression exp is greater than max.
  7. SDK_ALIGN4_ASSERT( exp ) is displayed when the value of evaluation expression exp is not a multiple of 4.
  8. SDK_ALIGN2_ASSERT( exp ) is displayed when the value of evaluation expression exp is not a multiple of 2.

These macro functions are for debug purposes and the RELEASE build and FINALROM build do not perform the output operation.

Arguments

exp The condition parameter.
fmt The display character string (format character string).
min The minimum value when judging a condition by the range.
max The maximum value when judging a condition by the range.

Return Values

None.

See Also

SDK_WARNING

Revision History

01/09/2004 Added the description that the RELEASE and ROM builds do not output
03/12/2004 Added SDK_ALIGN4_ASSERT, SDK_ALIGN2_ASSERT
02/27/2004 Initial version