From: Pekka Riikonen Date: Wed, 9 May 2007 19:48:08 +0000 (+0000) Subject: On WIN32 output __LINE__ in place of empty __FUNCTION__. X-Git-Tag: silc.toolkit.1.1.beta2~8 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=de1b3f29199809d58335449461a50f4d092fde9f On WIN32 output __LINE__ in place of empty __FUNCTION__. --- 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