Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Limbo.Preprocessor

Table of Contents

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;
}

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

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

Output

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

References