Fix compiling on FreeBSD.  Resolves issue #112.

(cherry picked from commit 882d4c6d8bde5ebf29b826d66525ccc669ee2bc7)