Added conditional compilation for OSX (Darwin)