Fix compilation on Windows with VS2012+

Inspired by
https://github.com/pvolok/gaze/commit/3740bd36cad0b2ed8035e41a9f89a8d181b41088