You can put this in src/win/util.c, that's where similar functions are defined in Windows.