fix windows build

There may be some additional fixes required on a real (cygwin) windows box; don't merge this yet.