common: Fix fallback code.

* common/logging.c (_log_assert): Fix the variant for compilers that
do not support __FUNCTION__.
* common/logging.h (_log_assert): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2017-01-10 12:31:46 +01:00
parent 0cc975d8a1
commit bfd6a49012
2 changed files with 2 additions and 2 deletions

View File

@ -1007,7 +1007,7 @@ void
_log_assert (const char *expr, const char *file, int line)
{
log_log (GPGRT_LOG_BUG, "Assertion \"%s\" failed (%s:%d)\n",
file, line, func);
expr, file, line);
abort (); /* Never called; just to make the compiler happy. */
}
#endif /*!GPGRT_HAVE_MACRO_FUNCTION*/

View File

@ -62,7 +62,7 @@ estream_t log_get_stream (void);
: _log_assert (#expr, __FILE__, __LINE__, __FUNCTION__))
#else /*!GPGRT_HAVE_MACRO_FUNCTION*/
void bug_at (const char *file, int line);
void _log_assert (const char *expr, const char *file, int line;
void _log_assert (const char *expr, const char *file, int line);
# define BUG() bug_at( __FILE__ , __LINE__ )
# define log_assert(expr) \
((expr) \