mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Add a tor_assert macro that logs failed assertions.
svn:r1695
This commit is contained in:
parent
70bbd0cafa
commit
e062ca046b
@ -40,6 +40,18 @@
|
||||
#define INLINE inline
|
||||
#endif
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define tor_assert(expr) do {} while(0)
|
||||
#else
|
||||
#define tor_assert(expr) do { \
|
||||
if (!(expr)) { \
|
||||
log(LOG_ERR, "%s:%d: %s: Assertion %s failed; aborting.", \
|
||||
__FILE__, __LINE__, __FUNCTION__, #expr); \
|
||||
assert(expr); /* write to console too. */ \
|
||||
abort(); /* unreached */ \
|
||||
} } while (0)
|
||||
#endif
|
||||
|
||||
/* legal characters in a filename */
|
||||
#define CONFIG_LEGAL_FILENAME_CHARACTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_/"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user