I’m wondering on how I could achieve performing a conditional function based on what operating system I’m using, for example,
if ( operatingSystem == Windows7 )
{
foo()
}
else if ( operatingSystem == WindowsXP )
{
etc()
}
I am pretty sure predefined macros won’t help me with this since you have to choose the OS macro before you compile, I want this program to be flexible and unfortunately preprocessor macros are the only answer I’m getting when I google it. Thank you for your time!
You can use
GetVersionEx(). Read GetVersionEx function and OSVERSIONINFOEX structure for details on how to interpret the data.