I have a bunch of unit tests that need to be conditional compiled based on Windows OS version.
This unit tests are testing TxF that is only available in Windows Vista and above.
#if WIN_OS_VERSION >= 6.0
// Run unit tests
#endif
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think there’s a way to conditionally compile code based on OS version. The documentation for #define states (emphasis mine):
You will have to conditionally run it instead:
Update:
This has been asked before.