|
|
||
|---|---|---|
| .. | ||
| check.h | ||
| README.md | ||
Assertion Checking
This module provide a variety of assert()-style macros. Unlike the
standard assert() macro from <assert.h>, most of these macros are
typed so the input values can be propogated to the string output on
failure.
For documentation, µnit offers very similar macros (this module was
originally based off of the macros from µnit), most of
the documentation for them
applies to this module's macros, just substitute the munit_ namespace
with psnip_.
Additionally, unless you define PSNIP_CHECK_FAIL_DEFINED, a failing
assertion should be considered undefined behavior when NDEBUG and/or
PSNIP_NDEBUG is defined. This allows the compiler to perform
optimizations which would not otherwise be possible.
Dependencies
To maximize portability you should #include the exact-int module before including check.h, but if you don't want to add the extra file to your project you can omit it and this module will simply rely on <stdint.h>. As an alternative you may define the following macros to appropriate values yourself:
psnip_int8_tpsnip_uint8_tpsnip_int16_tpsnip_uint16_tpsnip_int32_tpsnip_uint32_tpsnip_int64_tpsnip_uint64_t
Including Hedley before check.h will significantly improve compiler support and may improve performance.