Performing a conditional function based on windows OS

Hello all,

I'm wondering on how I could achieve performing a conditional function based on what operating system I'm using, for example,

1
2
3
4
5
6
7
8
if ( operatingSystem == Windows7 )
{
   foo()
}
else if ( operatingSystem == WindowsXP )
{
   etc()
}


Im 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 flexable and unfortunately preprocessor macros are the only answer I'm getting when I google it. Thank you for your time!
Thank you webJose! :)
Topic archived. No new replies allowed.