On WIN32 output __LINE__ in place of empty __FUNCTION__.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 9 May 2007 19:48:08 +0000 (19:48 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 9 May 2007 19:48:08 +0000 (19:48 +0000)
lib/silcutil/silclog.c
lib/silcutil/silclog_i.h

index 4369830b6376c6690dc0e463d90e53beedc9ceba..914a5fdfaae803fa65931db263c55ac05d0fcfbd 100644 (file)
@@ -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);
 
index 26156356d03aa7db50d67479c4f0504ee4415346..ccca84c98fad302225f2f6c19fb1f3404252226a 100644 (file)
@@ -26,7 +26,7 @@
 
 #if defined(WIN32)
 #ifndef __FUNCTION__
-#define __FUNCTION__ ""
+#define __FUNCTION__ __LINE__
 #endif
 #endif