aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-11-27 12:40:23 +0000
committerWerner Koch <[email protected]>2017-11-27 12:40:23 +0000
commitd1e3401013f85620f3136958be079c13ca758b20 (patch)
tree499cd45d83a0b6e1d71d4f2f815bb88966cc58a3
parentcore: Do not use the estream_t alias in gpg-error.h. (diff)
downloadlibgpg-error-d1e3401013f85620f3136958be079c13ca758b20.tar.gz
libgpg-error-d1e3401013f85620f3136958be079c13ca758b20.zip
core: Add new macro log_assert to the API.
* src/gpg-error.h.in (log_assert): New macro. Signed-off-by: Werner Koch <[email protected]>
-rw-r--r--src/gpg-error.h.in15
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*/