This seems to be more portable. Should fix compilation on OSX and FreeBSD. Apparently also works on MinGW-w64.