fix for compatibility between OSX and MingW