fix build on DragonFly BSD and FreeBSD
Merge pull request #1407 from jfhg/devel

fix build on DragonFly BSD and FreeBSD