fixed macro va args expansion for vs
use portable struct stat
C89 fixes