added #ifdef's to compile on Mac OS X