fixup last commit
This commit is contained in:
parent
1636ff8c49
commit
9fcc42d6ab
50
util.h
50
util.h
@ -33,35 +33,41 @@ void weprintf (const char *fmt, ...);
|
|||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
|
|
||||||
#define brandt_assert(expr) ((expr) ? (void)(0) : \
|
#define brandt_assert(expr) do { \
|
||||||
eprintf("Assertion failed in file %s line %d function %s: %s", \
|
(expr) ? (void)(0) : eprintf ( \
|
||||||
__FILE__, \
|
"Assertion failed in file %s line %d function %s: %s", \
|
||||||
__LINE__, \
|
__FILE__, \
|
||||||
__PRETTY_FUNCTION__, \
|
__LINE__, \
|
||||||
(#expr)))
|
__PRETTY_FUNCTION__, \
|
||||||
|
(# expr)); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define brandt_assert_perror(errnum) (!(errnum) ? (void)(0) : \
|
#define brandt_assert_perror(errnum) do { \
|
||||||
eprintf("Assertion failed in file %s line %d function %s:", \
|
!(errnum) ? (void)(0) : eprintf ( \
|
||||||
__FILE__, \
|
"Assertion failed in file %s line %d function %s:", \
|
||||||
__LINE__, \
|
__FILE__, \
|
||||||
__PRETTY_FUNCTION__))
|
__LINE__, \
|
||||||
|
__PRETTY_FUNCTION__); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define brandt_assert_gpgerr(errnum) (!(errnum) ? (void)(0) : \
|
#define brandt_assert_gpgerr(errnum) do { \
|
||||||
eprintf("Assertion failed in file %s line %d function %s: %s", \
|
!(errnum) ? (void)(0) : eprintf ( \
|
||||||
__FILE__, \
|
"Assertion failed in file %s line %d function %s: %s", \
|
||||||
__LINE__, \
|
__FILE__, \
|
||||||
__PRETTY_FUNCTION__, \
|
__LINE__, \
|
||||||
gcry_strerror((errnum))))
|
__PRETTY_FUNCTION__, \
|
||||||
|
gcry_strerror ((errnum))); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define DP(point) ((void)(gcry_log_debugpnt (#point, point, ec_ctx)))
|
#define DP(point) ((void)(gcry_log_debugpnt (# point, point, ec_ctx)))
|
||||||
#define DM(mpi) ((void)(gcry_log_debugmpi (#mpi, mpi, ec_ctx)))
|
#define DM(mpi) ((void)(gcry_log_debugmpi (# mpi, mpi, ec_ctx)))
|
||||||
|
|
||||||
#else
|
#else /* ifdef NDEBUG */
|
||||||
|
|
||||||
#define brandt_assert(expr) ((void)(expr))
|
#define brandt_assert(expr) ((void)(expr))
|
||||||
#define brandt_assert_perror(errnum) ((void)(errnum))
|
#define brandt_assert_perror(errnum) ((void)(errnum))
|
||||||
#define brandt_assert_gpgerr(errnum) ((void)(errnum))
|
#define brandt_assert_gpgerr(errnum) ((void)(errnum))
|
||||||
|
|
||||||
#endif
|
#endif /* ifdef NDEBUG */
|
||||||
|
|
||||||
#endif
|
#endif /* ifndef _BRANDT_UTIL_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user