<rdar://problem/13963648>

Changes after feedback:
Directly use function pointer, just to be safer on 10.8.