the solution is to include these lines in file winsock2.h
before the declaration of timeval (line 107)
#ifndef _TIMEVAL_DEFINED
#define _TIMEVAL_DEFINED
and close with #endif after #define timerclear
///insert this in winsock2.h - line 107 (pellesc 8)
#ifndef _TIMEVAL_DEFINED /* this already defined in sys/time.h */
#define _TIMEVAL_DEFINED
struct timeval {
long tv_sec;
long tv_usec;
};
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#define timercmp(tvp,uvp,cmp) ((tvp)->tv_sec cmp (uvp)->tv_sec || (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
#endif /* _TIMEVAL_DEFINED */