Support for 10.7

Sorry about the mess.

I think that the COMPILE_FOR_LION macro should be corrected.