Fix linux/freebsd/windows compilation