fix build issue for FreeBSD (bug #4802)