C++ Confusing Macros

Viewed 124

I was looking at some windows directx application code and saw that they use the macro _T(x) to set their window name, when looking at the macro definiton I saw this

#define _T(x)       __T(x)

then I followed and looked at __T

#define __T(x)      x

Why does this exist?

1 Answers

_T(x) is usually a macro for a platform agnostic text character type. In some platforms it may resolve to just x. In others using wide characters it may resolve to L ## x, e.g. _T("abc") may resolve to either "abc", or L"abc".

Related