On Tue, 23 Sep 2003, Stas Bekman wrote: > Randy Kobes wrote: > > On Mon, 22 Sep 2003, Stas Bekman wrote: > > > >>I've noticed from your reports that the tracing has more > >>problems: it doesn't report the function name. > > > > [ .. ] > > > >>there is no way to get the name of the currently executed > >>function on win32? > > > > > > There's not a __FUNCTION__ macro with VC++ 6 - one has been > > added in VC++ 7, I believe. > > Thanks Randy. Which version do you use to produce the > binaries? IF 7, may be it's worth to have another ifdef to > use it? > > > In such cases where it doesn't exist, might it be > > useful to report instead the __LINE__ and __FILE__? > > IMHO, it'll generate too much output, since the > paths/filenames would be too long, making the trace not so > useful. Or can you just show the __FILE__ w/o the path?
I've tried the following: ================================================================= Index: src/modules/perl/modperl_log.h =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_log.h,v retrieving revision 1.11 diff -u -r1.11 modperl_log.h --- src/modules/perl/modperl_log.h 23 Sep 2003 08:04:42 -0000 1.11 +++ src/modules/perl/modperl_log.h 25 Sep 2003 04:17:55 -0000 @@ -1,6 +1,9 @@ #ifndef MODPERL_LOG_H #define MODPERL_LOG_H +#define MP_STRINGIFY(n) MP_STRINGIFY_HELPER(n) +#define MP_STRINGIFY_HELPER(n) #n + #ifdef MP_TRACE # if defined(__GNUC__) # if (__GNUC__ > 2) @@ -9,7 +12,7 @@ # define MP_FUNC __FUNCTION__ # endif # else -# define MP_FUNC NULL +# define MP_FUNC __FILE__ ":" MP_STRINGIFY(__LINE__) # endif #else # define MP_FUNC NULL ================================================================== and it reports just the file:line combination, without the full path. -- best regards, randy --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
