Using platform.h instead of system headers

This way all the logic for deciding which headers need to be called is
kept inside platform.h.
Merge pull request #675 from cduclos/master

platform.h instead of system headers for HPUX