Cytosim PI Cytoskeleton Simulator

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Macros
assert_macro.h File Reference

Cytosim's assertions. More...

## Macros
#define | NDEBUG
#define | SFILE strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__
| strips the full pathname for a file name
#define | SFUNC __PRETTY_FUNCTION__
| print the current function name:
#define | TRACE fprintf(stderr, " while executing '%s'\n in file %s line %d\n", SFUNC, SFILE, __LINE__);
#define | assert_true(ignore) ((void) 0)
#define | assert_false(ignore) ((void) 0)
#define | assert_small(ignore) ((void) 0)
#define | ERROR(message)
#define | ABORT(message)
#define | EXIT(message, value)

## Macro Definition Documentation

#define ABORT | ( |  | message | ) |

Value:
{\
fprintf(stderr, "ERROR `%s'\n", message);\
TRACE;\
abort();\
}

#define assert_true | ( |  | ignore | ) | ((void) 0)

assert_true(X) stops the program if condition X is false. assert_false(X) stops if X is true, and prints the value of X.

#define ERROR | ( |  | message | ) |

Value:
{\
fprintf(stderr, "ERROR `%s'\n", message);\
TRACE;\
exit(EXIT_FAILURE);\
}

ERROR(message) simply stops the program with some information ABORT(message) will generate a Core file in addition EXIT(message, value) will stop the program with the specified exit value

#define EXIT | ( |  | message,
|  |  | value
| ) |  |

Value:
{\
fprintf(stderr, "Cytosim: %s\n", message);\
exit(value);\
}

#define NDEBUG

defining NDEBUG disables:

- the standard assert() macro and
- the assert macros defined below, it makes the executable faster but less safe: