The following compiles and runs fine on Windows MSVC compiler (Visual Studio IDE 2019):
#include <iostream>
#include <boost/stacktrace.hpp>
//class INPUT {
// int xyz;
//};
void function() {
std::cout << boost::stacktrace::stacktrace();
}
int main() {
function();
}
and produces the correct stacktrace inside of function()
.
However, on uncommenting out my class definition called INPUT
, it fails to compile because of a name clash with a similarly named class in internal Windows file, WinUser.h
typedef struct tagINPUT {
DWORD type;
union
{
MOUSEINPUT mi;
KEYBDINPUT ki;
HARDWAREINPUT hi;
} DUMMYUNIONNAME;
} INPUT, *PINPUT, FAR* LPINPUT;
Apart from renaming my class differently, is there any other way to avoid such name clashes?