From de1b3f29199809d58335449461a50f4d092fde9f Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 9 May 2007 19:48:08 +0000 Subject: [PATCH] On WIN32 output __LINE__ in place of empty __FUNCTION__. --- lib/silcutil/silclog.c | 6 ++++++ lib/silcutil/silclog_i.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/silcutil/silclog.c b/lib/silcutil/silclog.c index 4369830b..914a5fdf 100644 --- a/lib/silcutil/silclog.c +++ b/lib/silcutil/silclog.c @@ -458,6 +458,12 @@ void silc_log_output_debug(char *file, const char *function, goto end; } +#ifdef SILC_WIN32 + if (strrchr(function, '\\')) + fprintf(stderr, "%s:%d: %s\n", strrchr(function, '\\') + 1, line, string); + else +#endif /* SILC_WIN32 */ + fprintf(stderr, "%s:%d: %s\n", function, line, string); fflush(stderr); diff --git a/lib/silcutil/silclog_i.h b/lib/silcutil/silclog_i.h index 26156356..ccca84c9 100644 --- a/lib/silcutil/silclog_i.h +++ b/lib/silcutil/silclog_i.h @@ -26,7 +26,7 @@ #if defined(WIN32) #ifndef __FUNCTION__ -#define __FUNCTION__ "" +#define __FUNCTION__ __LINE__ #endif #endif -- 2.43.0