Fix compilation on Mac OS X / DragonFly BSD.

  This closes #179.