Mac OS X support + fix warnings

Andrew Danforth apparently doesn't missing this so now I consider your repository upstream.

This pull requests makes it possible to build and install the library on Mac OS X and fixes a few `size_t`-related warnings.