fix a clang warning
add freebsd support