From: Bob on
I'm trying to port some code that used __func__ to identify the current
function,
to GCC that uses something else, so I'm trying to use __WXFUNCTION__ as
documented
here:

http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_miscellany.html#wxfunction

This version compiles, unlike all of my other attempts:

wxLogVerbose( wxT( "File: %s Function: %s Line: %d" ), wxT(__FILE__),
__WXFUNCTION__, __LINE__ );

but returns this:

08:53:40: File: program.cpp Function: ???t Line: 74

Clearly the functions is not called "???t".

What am I doing wrong?

This is with GCC wx2.8.7 UNICODE.
From: Vadim Zeitlin on
On Sun, 20 Apr 2008 09:00:48 -0400 Bob <wxwidgets(a)gmail.com> wrote:

B> wxLogVerbose( wxT( "File: %s Function: %s Line: %d" ), wxT(__FILE__),
B> __WXFUNCTION__, __LINE__ );
B>
B> but returns this:
B>
B> 08:53:40: File: program.cpp Function: ???t Line: 74
B>
B> Clearly the functions is not called "???t".
B>
B> What am I doing wrong?
B>
B> This is with GCC wx2.8.7 UNICODE.

In 2.8 Unicode build you must pass Unicode strings to wxLogVerbose() but
__WXFUNCTION__ is ASCII.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

From: Bob on
>
>
> In 2.8 Unicode build you must pass Unicode strings to wxLogVerbose() but
> __WXFUNCTION__ is ASCII.


This worked:

wxLogVerbose( wxT( "File: %s Function: %s Line: %d" ), wxT(__FILE__),
wxString::FromAscii(__WXFUNCTION__).c_str(), __LINE__ );


Regards,
> VZ


Thank you for your help.