fixing build of 2.4 branch with VC12 (aka 2013)
(master branch was fixed before, no need to merge this to master!)
- disable openexr (numerous undefined std::min & std::max)
- workaround for two compilator bugs
Added patch from master for fixing VS2013 in 3rd party lib OpenEXR
fixing compilation on Linux
Merge pull request #1911 from apavlenko:2.4_fix_vc12