Fix compile error for cygwin1.7.18, add check __CYGWIN_ macro.
Merge pull request #265 from kuwa72/issue263_2

Fix compile error for cygwin1.7.18, add check __CYGWIN__ macro.