![]() |
This is Unofficial EPICS BASE Doxygen Site
|
An EPICS-specific replacement for ANSI C's assert. More...
Go to the source code of this file.
Macros | |
#define | epicsAssertAuthor 0 |
Optional string giving the author's name. More... | |
#define | assert(exp) |
Declare that a condition should be true. More... | |
#define | STATIC_JOIN(x, y) STATIC_JOIN2(x, y) |
#define | STATIC_JOIN2(x, y) x ## y |
#define | STATIC_ASSERT(expr) |
Declare a condition that should be true at compile-time. More... | |
An EPICS-specific replacement for ANSI C's assert.
To use this version just include:
instead of
If an assert() fails, it calls errlog indicating the program's author, file name, and line number. Under each OS there are specialized instructions assisting the user to diagnose the problem and generate a good bug report. For instance, under vxWorks, there are instructions on how to generate a stack trace, and on posix there are instructions about saving the core file. After printing the message the calling thread is suspended. An author may, before the above include line, optionally define a preprocessor macro named epicsAssertAuthor as a string that provides their name and email address if they wish to be contacted when the assertion fires.
This header also provides a compile-time assertion macro STATIC_ASSERT() which can be used to check a constant-expression at compile-time. The C or C++ compiler will flag an error if the expresstion evaluates to 0. The STATIC_ASSERT() macro can only be used where a typedef
is syntactically legal.
Definition in file epicsAssert.h.
#define assert | ( | exp | ) |
Declare that a condition should be true.
exp | Expression that should evaluate to True. |
Definition at line 70 of file epicsAssert.h.
#define epicsAssertAuthor 0 |
Optional string giving the author's name.
Definition at line 54 of file epicsAssert.h.
#define STATIC_ASSERT | ( | expr | ) |
Declare a condition that should be true at compile-time.
expr | A C/C++ const-expression that should evaluate to True. |
Definition at line 86 of file epicsAssert.h.
#define STATIC_JOIN | ( | x, | |
y | |||
) | STATIC_JOIN2(x, y) |
Definition at line 80 of file epicsAssert.h.
#define STATIC_JOIN2 | ( | x, | |
y | |||
) | x ## y |
Definition at line 81 of file epicsAssert.h.