As of Mingw32 980309 the <limits.h> header is broken.
Apply this small patch:


*** limits.h.org	Wed Nov 26 00:35:52 1997
--- limits.h	Tue Apr 28 02:06:04 1998
***************
*** 78,82 ****
  #define SHRT_MIN	(-SHRT_MAX-1)
  
! #define USHRT_MAX	((unsigned short) (2U * SHRT_MAX + 1))
  
  /*
--- 78,82 ----
  #define SHRT_MIN	(-SHRT_MAX-1)
  
! #define USHRT_MAX	65535
  
  /*
