This check is not enough - on OSX 10.6 this code would crash. You also have to test for >= 10.7