I have an application that needs to operate on Windows 2000. I’d also like to use Visual Studio 2010 (mainly because of the change in the definition of the auto keyword). However, I’m in a bit of a bind because I need the app to be able to operate on older OS’s, namely:
- Windows 2000
- Windows XP RTM
- Windows XP SP1
Visual Studio 2010’s runtime library depends on the EncodePointer / DecodePointer API which was introduced in Windows XP SP2.
If using the alternate runtime library is possible, will this break code that relies on C++0x features added in VS2010, like std::regex?
Suma’s solution looked pretty promising, but it doesn’t work: the
__imp__*@4symbols need to be pointers to functions, rather than the functions themselves. Unfortunately, I don’t know how to make Visual C++ spit out a pointer with that kind of name generation… (well,__declspec(naked)combined with__stdcalldoes the trick, but then I don’t know how to emit a pointer).If using an assembler at build-time is OK, the solution is pretty trivial – assemble the following code with FASM and link against the produced object file, and presto – no EncodePointer/DecodePointer references in the exe: