[or-cvs] Make log_fn not fail so miserably on VC6

Nick Mathewson nickm at seul.org
Mon Nov 15 23:30:29 UTC 2004


Update of /home/or/cvsroot/tor/src/common
In directory moria.mit.edu:/tmp/cvs-serv18385/src/common

Modified Files:
	log.c log.h 
Log Message:
Make log_fn not fail so miserably on VC6

Index: log.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/log.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- log.c	15 Nov 2004 21:18:07 -0000	1.68
+++ log.c	15 Nov 2004 23:30:26 -0000	1.69
@@ -203,7 +203,6 @@
   va_end(ap);
 }
 
-
 /** Output a message to the log, prefixed with a function name <b>fn</b>. */
 #ifdef __GNUC__
 void _log_fn(int severity, const char *fn, const char *format, ...)

Index: log.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/log.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- log.h	15 Nov 2004 21:18:07 -0000	1.34
+++ log.h	15 Nov 2004 23:30:26 -0000	1.35
@@ -80,6 +80,9 @@
  * of the current function name. */
 #define log_fn(severity, args...) \
   _log_fn(severity, __PRETTY_FUNCTION__, args)
+#elif defined(_MSC_VER) && _MSC_VER < 1300
+/* MSVC 6 and earlier don't have __FUNCTION__, or even __LINE__. */
+#define log_fn _log
 #else
 /* We don't have GCC's varargs macros, so use a global variable to pass the
  * function name to log_fn */



More information about the tor-commits mailing list