Adding support for Mac OSX.

Compiles fine on 10.9,
$ uname -a
Darwin mikalv.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST
2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64