mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-01 16:33:02 +01:00
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:
parent
0cc975d8a1
commit
bfd6a49012
@ -1007,7 +1007,7 @@ void
|
|||||||
_log_assert (const char *expr, const char *file, int line)
|
_log_assert (const char *expr, const char *file, int line)
|
||||||
{
|
{
|
||||||
log_log (GPGRT_LOG_BUG, "Assertion \"%s\" failed (%s:%d)\n",
|
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. */
|
abort (); /* Never called; just to make the compiler happy. */
|
||||||
}
|
}
|
||||||
#endif /*!GPGRT_HAVE_MACRO_FUNCTION*/
|
#endif /*!GPGRT_HAVE_MACRO_FUNCTION*/
|
||||||
|
@ -62,7 +62,7 @@ estream_t log_get_stream (void);
|
|||||||
: _log_assert (#expr, __FILE__, __LINE__, __FUNCTION__))
|
: _log_assert (#expr, __FILE__, __LINE__, __FUNCTION__))
|
||||||
#else /*!GPGRT_HAVE_MACRO_FUNCTION*/
|
#else /*!GPGRT_HAVE_MACRO_FUNCTION*/
|
||||||
void bug_at (const char *file, int line);
|
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 BUG() bug_at( __FILE__ , __LINE__ )
|
||||||
# define log_assert(expr) \
|
# define log_assert(expr) \
|
||||||
((expr) \
|
((expr) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user