port: fully compile on g++