remove more redundant code in platform.h