diff options
author | Werner Koch <wk@gnupg.org> | 2017-11-27 13:40:23 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2017-11-27 13:40:23 +0100 |
commit | d1e3401013f85620f3136958be079c13ca758b20 (patch) | |
tree | 499cd45d83a0b6e1d71d4f2f815bb88966cc58a3 /src/gpg-error.h.in | |
parent | e0ef8126c20216f79b7ad147c103bb2cf2790c59 (diff) | |
download | libgpg-error-d1e3401013f85620f3136958be079c13ca758b20.tar.gz |
core: Add new macro log_assert to the API.
* src/gpg-error.h.in (log_assert): New macro.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/gpg-error.h.in')
-rw-r--r-- | src/gpg-error.h.in | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in index f157fd8..35027d6 100644 --- a/src/gpg-error.h.in +++ b/src/gpg-error.h.in @@ -955,8 +955,7 @@ void _gpgrt_log_assert (const char *expr, const char *file, int line, ? (void) 0 \ : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__)) #else /*!GPGRT_HAVE_MACRO_FUNCTION*/ -void _gpgrt_log_assert (const char *expr, const char *file, int line); -#define gpgrt_assert(expr) \ +# define gpgrt_assert(expr) \ ((expr) \ ? (void) 0 \ : _gpgrt_log_assert (#expr, __FILE__, __LINE__, NULL)) @@ -989,6 +988,18 @@ void _gpgrt_log_assert (const char *expr, const char *file, int line); # define log_printhex gpgrt_log_printhex # define log_clock gpgrt_log_clock # define log_flush gpgrt_log_flush +# ifdef GPGRT_HAVE_MACRO_FUNCTION +# define log_assert(expr) \ + ((expr) \ + ? (void) 0 \ + : _gpgrt_log_assert (#expr, __FILE__, __LINE__, __FUNCTION__)) +# else /*!GPGRT_HAVE_MACRO_FUNCTION*/ +# define log_assert(expr) \ + ((expr) \ + ? (void) 0 \ + : _gpgrt_log_assert (#expr, __FILE__, __LINE__, NULL)) +# endif /*!GPGRT_HAVE_MACRO_FUNCTION*/ + #endif /*GPGRT_ENABLE_LOG_MACROS*/ |