Add #ifdefs to make compatible with Ubuntu