- DECLARE_LOG_FUNCTION2(Trace, wxTraceMask mask);
-#else //!debug
- // these functions do nothing in release builds
- inline void wxVLogDebug(const wxChar *, va_list) { }
- inline void wxLogDebug(const wxChar *, ...) { }
- inline void wxVLogTrace(wxTraceMask, const wxChar *, va_list) { }
- inline void wxLogTrace(wxTraceMask, const wxChar *, ...) { }
- inline void wxVLogTrace(const wxChar *, const wxChar *, va_list) { }
- inline void wxLogTrace(const wxChar *, const wxChar *, ...) { }
+ DECLARE_LOG_FUNCTION2_IMPL(Trace, wxTraceMask, mask);
+ DECLARE_LOG_FUNCTION_PUBLIC(Trace);
+#else //!debug || !wxUSE_LOG
+ // these functions do nothing in release builds, but don't define them as
+ // nothing as it could result in different code structure in debug and
+ // release and this could result in trouble when these macros are used
+ // inside if/else
+ //
+ // note that making wxVLogDebug/Trace() themselves (empty inline) functions
+ // is a bad idea as some compilers are stupid enough to not inline even
+ // empty functions if their parameters are complicated enough, but by
+ // defining them as an empty inline function we ensure that even dumbest
+ // compilers optimise them away
+ inline void wxLogNop() { }
+
+ #define wxVLogDebug(fmt, valist) wxLogNop()
+ #define wxVLogTrace(mask, fmt, valist) wxLogNop()
+
+ #ifdef HAVE_VARIADIC_MACROS
+ // unlike the inline functions below, this completely removes the
+ // wxLogXXX calls from the object file:
+ #define wxLogDebug(fmt, ...) wxLogNop()
+ #define wxLogTrace(mask, fmt, ...) wxLogNop()
+ #else // !HAVE_VARIADIC_MACROS
+ //inline void wxLogDebug(const wxString& fmt, ...) {}
+ WX_DEFINE_VARARG_FUNC_NOP(wxLogDebug)
+ //inline void wxLogTrace(wxTraceMask, const wxString& fmt, ...) {}
+ //inline void wxLogTrace(const wxString&, const wxString& fmt, ...) {}
+ WX_DEFINE_VARARG_FUNC_NOP(wxLogTrace)
+ #endif // HAVE_VARIADIC_MACROS/!HAVE_VARIADIC_MACROS