From: Marc W. <Mar...@si...> - 2004-10-15 08:14:41
|
Am Donnerstag, 14. Oktober 2004 16.23 schrieb Marc Waeckerlin <Marc Waeckerlin <Mar...@si...>> unter "[Opencxx-users] "ChangeDefaultMetaclass" and "metaclass declaration"": > Possible solutions: > > - Find a way to include fntrace.hxx as very first file > > - Start OpenC++ metaclass instrumentation only after > inclusion of fntrace.hxx (i.e. with a "metaclass > declaration", by adding the line "metaclass > IsTraceClass;" as last line in header fntrace.hxx) > > The latter is exactly what I tried and why I send this > error report. > > Any other idea? I got a solution, even though it is not the best: Before I trace anything, I check the filename and I don't trace, if I am either in a file with absolute (not relative) pathname or if i am in the tracer declaration: int line; Opencxx::Ptree* fname (env->GetLineNumber (Opencxx::PtreeUtil::First(body), line)); if (std::string(fname->ToString()).find('/')==0 || std::string(fname->ToString())=="fntrace.hxx") return false; Any idea for a better solution? Ok, to make it Windoze compatible, the "find" should probably be changed to: find_first_of("/\\") and "fname" could be instanciated as std::string instead of converting it twice, but besides of minor enhancement, is there a better, totally different approach? Regards Marc |