Rename pjdlog_verify() to pjdlog_abort() as it better describes what the
the function does and mark it with __dead2. MFC after: 1 week
This commit is contained in:
parent
d39a3a978b
commit
05a6b8de87
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=218132
@ -437,10 +437,10 @@ pjdlog_exitx(int exitcode, const char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Log assertion and exit.
|
* Log failure message and exit.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pjdlog_verify(const char *func, const char *file, int line,
|
pjdlog_abort(const char *func, const char *file, int line,
|
||||||
const char *failedexpr, const char *fmt, ...)
|
const char *failedexpr, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -89,22 +89,22 @@ void pjdlogv_exit(int exitcode, const char *fmt, va_list ap) __printflike(2, 0)
|
|||||||
void pjdlog_exitx(int exitcode, const char *fmt, ...) __printflike(2, 3) __dead2;
|
void pjdlog_exitx(int exitcode, const char *fmt, ...) __printflike(2, 3) __dead2;
|
||||||
void pjdlogv_exitx(int exitcode, const char *fmt, va_list ap) __printflike(2, 0) __dead2;
|
void pjdlogv_exitx(int exitcode, const char *fmt, va_list ap) __printflike(2, 0) __dead2;
|
||||||
|
|
||||||
void pjdlog_verify(const char *func, const char *file, int line,
|
void pjdlog_abort(const char *func, const char *file, int line,
|
||||||
const char *failedexpr, const char *fmt, ...) __printflike(5, 6);
|
const char *failedexpr, const char *fmt, ...) __printflike(5, 6) __dead2;
|
||||||
|
|
||||||
#define PJDLOG_VERIFY(expr) do { \
|
#define PJDLOG_VERIFY(expr) do { \
|
||||||
if (!(expr)) { \
|
if (!(expr)) { \
|
||||||
pjdlog_verify(__func__, __FILE__, __LINE__, #expr, \
|
pjdlog_abort(__func__, __FILE__, __LINE__, #expr, \
|
||||||
__func__); \
|
__func__); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define PJDLOG_RVERIFY(expr, ...) do { \
|
#define PJDLOG_RVERIFY(expr, ...) do { \
|
||||||
if (!(expr)) { \
|
if (!(expr)) { \
|
||||||
pjdlog_verify(__func__, __FILE__, __LINE__, #expr, \
|
pjdlog_abort(__func__, __FILE__, __LINE__, #expr, \
|
||||||
__VA_ARGS__); \
|
__VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define PJDLOG_ABORT(...) pjdlog_verify(__func__, __FILE__, \
|
#define PJDLOG_ABORT(...) pjdlog_abort(__func__, __FILE__, \
|
||||||
__LINE__, NULL, __VA_ARGS__)
|
__LINE__, NULL, __VA_ARGS__)
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
#define PJDLOG_ASSERT(expr) do { } while (0)
|
#define PJDLOG_ASSERT(expr) do { } while (0)
|
||||||
|
Loading…
Reference in New Issue
Block a user