move other portable code into port.h, avoid 'z' to print size_t, still can not use -std=gnu99 in mingw