2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 20:00:53 +00:00
qpdf/libqpdf/qpdf/assert_test.h
Jay Berkenbilt 62bf296a9c Make assert handling less error-prone
Prevent my future self or other contributors from using assert in
tests and then having that assert not do anything because of the
NDEBUG macro.
2022-05-03 18:31:22 -04:00

21 lines
522 B
C

/*
* Include this file to use assert in regular code for
* debugging/strong sanity checking, knowing that the assert will be
* disabled in release code. Use qpdf_debug_assert in the code.
*/
/* assert_debug and assert_test intentionally use the same
* guard. Search for assert in README-MAINTAINER.
*/
#ifdef QPDF_ASSERT_H
# error "At most one qpdf/assert header may be included at most one time"
#else
# define QPDF_ASSERT_H
# ifdef NDEBUG
# undef NDEBUG
# endif
# include <assert.h>
#endif /* QPDF_ASSERT_H */