fix build on FreeBSD