mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Add panic() into redisassert.h.
This header file is for libs, like ziplist.c, that we want to leave almost separted from the core. The panic() calls will be easy to delete in order to use such files outside, but the debugging info we gain are very valuable compared to simple assertions where it is not possible to print debugging info.
This commit is contained in:
parent
53b8bf2c89
commit
17ac46ea78
@ -41,7 +41,9 @@
|
|||||||
#include <unistd.h> /* for _exit() */
|
#include <unistd.h> /* for _exit() */
|
||||||
|
|
||||||
#define assert(_e) ((_e)?(void)0 : (_serverAssert(#_e,__FILE__,__LINE__),_exit(1)))
|
#define assert(_e) ((_e)?(void)0 : (_serverAssert(#_e,__FILE__,__LINE__),_exit(1)))
|
||||||
|
#define panic(...) _serverPanic(__FILE__,__LINE__,__VA_ARGS__),_exit(1)
|
||||||
|
|
||||||
void _serverAssert(char *estr, char *file, int line);
|
void _serverAssert(char *estr, char *file, int line);
|
||||||
|
void _serverPanic(const char *file, int line, const char *msg, ...);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user