Index: libsrc/error.c
===================================================================
--- libsrc/error.c	(revision 2852)
+++ libsrc/error.c	(revision 2872)
@@ -22,6 +22,10 @@
 #include <netcdf.h>
 #endif
 
+#ifdef WIN32
+#define HAVE_STRERROR
+#endif 
+
 #ifdef HAVE_STRERROR
 #include <string.h> /* contains prototype for ansi libc function strerror() */
 #else
Index: ncdump/dumplib.c
===================================================================
--- ncdump/dumplib.c	(revision 2852)
+++ ncdump/dumplib.c	(revision 2872)
@@ -24,6 +24,10 @@
 #include "dumplib.h"
 #include "isnan.h"
 
+#ifdef WIN32
+#define snprintf _snprintf
+#endif
+
 static float float_eps;
 static double double_eps;
 
Index: ncdump/ncdump.c
===================================================================
--- ncdump/ncdump.c	(revision 2852)
+++ ncdump/ncdump.c	(revision 2872)
@@ -6,13 +6,19 @@
 
 #include <config.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 #include <assert.h>
 #include <math.h>
 
+#ifdef WIN32
+#include <io.h>
+#define snprintf _snprintf
+#else
+#include <unistd.h>
+#endif
+
 #include <netcdf.h>
 #include "ncdump.h"
 #include "dumplib.h"
Index: ncgen/genlib.c
===================================================================
--- ncgen/genlib.c	(revision 2852)
+++ ncgen/genlib.c	(revision 2872)
@@ -20,6 +20,11 @@
 #include "ncgen.h"
 #include "genlib.h"
 
+#ifdef WIN32
+#define snprintf _snprintf
+#endif
+
+
 extern char *netcdf_name; /* output netCDF filename, if on command line. */
 extern int netcdf_flag;
 extern int c_flag;
Index: ncgen/main.c
===================================================================
--- ncgen/main.c	(revision 2852)
+++ ncgen/main.c	(revision 2872)
@@ -6,13 +6,18 @@
 
 #include <config.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <string.h>
 
+#ifdef WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
 #ifdef __hpux
 #include <locale.h>
 #endif
-    
+
 #include <netcdf.h>
 
 #include "generic.h"
Index: libsrc/netcdf.h
===================================================================
--- libsrc/netcdf.h	(revision 2852)
+++ libsrc/netcdf.h	(revision 2872)
@@ -224,13 +224,17 @@
 #  endif
 #include <io.h>
 #define lseek _lseeki64
+#define _OFF_T_DEFINED //Needed to make VS2005 work
 #define off_t __int64
+#define _STAT_DEFINED //Needed to make VS2005 work
 #define stat __stat64
 #define fstat _fstat64
+
 #else
 #define MSC_EXTRA
 #endif	/* defined(DLL_NETCDF) */
 
+
 # define EXTERNL extern MSC_EXTRA
 
 /* When netCDF is built as a DLL, this will export ncerr and
Index: nc_test/tests.h
===================================================================
--- nc_test/tests.h	(revision 2852)
+++ nc_test/tests.h	(revision 2872)
@@ -35,7 +35,7 @@
 /* FLT_MAX < X_FLOAT_MAX */
 #define X_FLOAT_MAX	FLT_MAX
 #else
-#define X_FLOAT_MAX	3.40282347e+38f
+#define X_FLOAT_MAX	3.40282346e+38f
 #endif
 #define X_FLOAT_MIN	(-X_FLOAT_MAX)
 #if CRAYFLOAT
