I have a Windows Phone 8 Solution with a Windows Runtime Component project. In the WinRT code I want to use __FUNCTION__
for logging from a C++ class.
However, __FUNCTION__
is not defined whereas __LINE__
is.
Intellisense only suggests __FUNCTIONW__
to use. But when I jump to the definition of __FUNCTIONW__
in crtdefs.h
I can see that __FUNCTION__
is not defined there either:
I have read Why would __FUNCTION__ be undefined? but that did not help me (or I did not understand the problem described there correctly)
How could __FUNCTION__
not be defined? I thought it is build in to the compiler...
Update:
OK, I learned that __FUNCTION__
is actually never colored. Yet I get an error when I type:
TCHAR* f = _T(__FUNCTION__);
It says:
Error: Identifier "L__FUNCTION__" is undefined
Maybe something is wrong with my UNICODE setup? Is there a special header that I need to include?