Ifdef some OS X only code to fix Linux build.