My problem is very much related the post Defined macro not recognized
I wrote a CMakeLists file to be able to build my project for OS X (Eclipse mostly but sometimes used Xcode) and Windows (Visual Studio). The issue showed up today when creating my project for Windows + MinGW. I was using the defined _WIN32
to enable some functions when I was in windows, i.e.
bool Normal::HasNaNs() const
{
#ifdef _WIN32
return _isnan(x) || _isnan(y) || _isnan(z);
#else
return isnan(x) || isnan(y) || isnan(z);
#endif
}
However, with the combo Eclipse+MinGW the code is entering the ifdef part instead of (what I was hoping/thinking should be correct) entering the else part. I think Visual is the only one having the _isnan()
function.
So, what would be a more robust way to check for Windows+VS, Windows+MinGW, OSX ?