Get rid of a lot of WIN32 ifdefs by providing a compatibility function instead