making Mac specific code conditional