Include #ifndef routine in auto generated header.
Also fixed various compile problem on CYGWIN.