Limbo 3.5.4
Loading...
Searching...
No Matches
Limbo.Preprocessor

Introduction

Some macros such as assertion with message.

Examples

test_msg.cpp

int main()
{
int a = 1;
int b = 2;
limboPrint(limbo::kDEBUG, "a = %d, b = %d\n", a, b);
limboAssertMsg(a+b < 3, "a+b fails to be less than 3: a+b = %d", a+b);
return 0;
}
#define limboAssertMsg(condition, args...)
custom assertion with message
Definition AssertMsg.h:24
header to include PrintMsg.h and AssertMsg.h
int main()

Compiling and running commands (assuming LIMBO_DIR is exported as the environment variable to the path where limbo library is installed)

g++ -o test_msg test_msg.cpp -I $LIMBO_DIR/include
./test_msg

Output

(D) a = 1, b = 2
(A) test_msg.cpp:14: int main(): Assertion `a+b < 3' failed: a+b fails to be less than 3: a+b = 3
Aborted

References