add conditional compilation to build on OSX