Add platform.h & make platform defines consistent