0

I've got a log macro that looks something like this:

#define LOG(formatString, ...) \
{ Log( TEXT(__FUNCTION__) TEXT(" ") ## formatString TEXT("\r\n"), ##__VA_ARGS__);  } 

It compiles and works fine, however it seems to trip up visual studio intellisense which underlines all uses of the macro in red with the error:

IntelliSense: identifier "L__FUNCTION__" is undefined

I'm thinking of raising this to microsoft, but in the meantime, is there a workaround that is as efficient at runtime which will not trip intellisense up?

Scott Langham
  • 58,735
  • 39
  • 131
  • 204
  • possible duplicate of [Intellisense error when using \`\_\_FUNCTIONW\_\_\`](http://stackoverflow.com/questions/26745594/intellisense-error-when-using-functionw) – deW1 Nov 18 '14 at 14:29
  • 1
    You don't want to workaround that, you want to fix it. You want `__FUNCTION__` expanded before the concatenation. Two levels of macro expansion is the usual cure for such. – Cheers and hth. - Alf Nov 18 '14 at 14:30
  • Hmm, thought I'd solved it by using an expand macro, but I actually just ended up with the text "__func__" instead of it being expanded. – Scott Langham Nov 18 '14 at 16:36

0 Answers0