BurgerLib
Classes | Defines
brdebug.h File Reference
#include "brtypes.h"
Include dependency graph for brdebug.h:
This graph shows which files directly or indirectly include this file:

Classes

class  BRDebug
struct  BRDebug::BRDebugLocals_t

Defines

#define BRASSERT(conditional)   ((conditional) ? ((void)NULL) : BRDebug::Fatal("Assertion at %s, %i", __FILE__, __LINE__))
 Throw a fatal assert on debug builds.
#define BRASSERTTEST(conditional)   ((conditional) ? TRUE : BRDebug::Fatal("Assertion at %s, %i", __FILE__, __LINE__))
 Throw a fatal assert on debug builds.

Define Documentation

#define BRASSERT (   conditional)    ((conditional) ? ((void)NULL) : BRDebug::Fatal("Assertion at %s, %i", __FILE__, __LINE__))

Throw a fatal assert on debug builds.

Test if the conditional is false, if it is, call BRDebug::Fatal and force the application to immediately exit.

Note:
If this is a release build, this macro will completely vanish and the conditional is not tested.
    int iResult = GetErrorFlag();   // Zero means no error
    BRASSERT(!iResult);             // Die if an error occured on debug builds
Parameters:
conditionalAnything that resolves to TRUE or FALSE.
See also:
BRASSERTTEST
#define BRASSERTTEST (   conditional)    ((conditional) ? TRUE : BRDebug::Fatal("Assertion at %s, %i", __FILE__, __LINE__))

Throw a fatal assert on debug builds.

Test if the conditional is false, if it is, call BRDebug::Fatal and force the application to immediately exit.

Note:
If this is a release build, this macro will perform the conditional test but it will not call BRDebug::Fatal.
    int iResult = GetErrorFlag();       // Zero means no error
    if (BRASSERTTEST(!iResult)) {       // Die if an error occured on debug builds
        CodeWasGood();
    } else {
        printf("Error %i has occured!\n",iResult);
        return;
    }
Parameters:
conditionalAnything that resolves to TRUE or FALSE.
Returns:
TRUE or FALSE, the result of the test of the conditional to zero.
See also:
BRASSERT