extern bool hex2bin(char *src, char *dst, int length);
extern void bin2hex(char *src, char *dst, int length);
-#ifdef HAVE_MINGW
+#if defined(HAVE_MINGW) || defined(HAVE_CYGWIN)
extern const char *winerror(int);
+#endif
+
+#ifdef HAVE_MINGW
#define strerror(x) ((x)>0?strerror(x):winerror(GetLastError()))
#define sockerrno WSAGetLastError()
#define sockstrerror(x) winerror(x)
extern unsigned int bitfield_to_int(const void *bitfield, size_t size);
-int memcmp_constant_time (const void *a, const void *b, size_t size);
+int memcmp_constant_time(const void *a, const void *b, size_t size);
#endif