fix compile error on FreeBSD