fix some compile bug with cygwin g++ compiler