Reputation: 7309
I'm getting the same warning as described in this question. The answer works, but since my program should be able to run in XP, Vista and 7, I worry that if I define the Windows version to be XP, I'll have problems in the other systems.
Even if I did define a specific version, I'd have to set it in all my C++ projects, which is a hassle. I thought of creating separate build configurations for XP, Vista and 7, each with the correct preprocessor definition in all C++ projects. Is there a more elegant solution?
Upvotes: 0
Views: 223
Reputation: 54669
The APIs are backward compatible, so you should set the define to the lowest version you want to support. In your case, for XP and up, set it to 0x0501
. Should you want to support Win2k as well, set it to 0x0500
.
Microsoft puts a lot of effort into ensuring that newer operating systems don't break APIs and even if they did you still have an additional layer of abstraction with boost.asio.
Your idea with the different build configurations is not bad, but it will only pay off, if you specifically plan to use newer features, that are not available on all versions you want to support. Boost.asio, for example, only uses a subset of Winsock from the Win32 API, so you would gain absolutely nothing here.
Upvotes: 1