fix ios_t layout for 32-bit. hopefully fixes #6016

also move word-size detection to platform.h where it seems to belong