assert.h: add comments explaining the omission of include guards
This commit is contained in:
parent
e4de39c4e4
commit
c7ad68f08c
@ -3,6 +3,22 @@
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
/* Include guards are omitted, as assert.h is required
|
||||
to support being included multiple times.
|
||||
|
||||
E.g. the following is required to be valid:
|
||||
|
||||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
|
||||
assert(0); // this assertion will be triggered
|
||||
|
||||
#define NDEBUG
|
||||
#include <assert.h>
|
||||
|
||||
assert(0); // this assertion will not be triggered
|
||||
*/
|
||||
|
||||
#undef assert
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
Loading…
x
Reference in New Issue
Block a user