]> sjero.net Git - wget/blobdiff - src/mswindows.h
[svn] Large file fixes for Borland C, published in
[wget] / src / mswindows.h
index e66fa3145748e38d58d53e3091974a9907deb76c..0b795af4146e1b0bd18160aef7b0b8c1f2974109 100644 (file)
@@ -80,25 +80,41 @@ so, delete this exception statement from your version.  */
 #define snprintf _snprintf
 #define vsnprintf _vsnprintf
 
-/* No stat on Windows.  */
+/* Define a wgint type under Windows. */
+typedef __int64 wgint;
+#define SIZEOF_WGINT 8
+#define WGINT_MAX 9223372036854775807I64
+
+#define str_to_wgint str_to_int64
+__int64 str_to_int64 (const char *, char **, int);
+
+/* No lstat on Windows.  */
 #define lstat stat
 
-#define PATH_SEPARATOR '\\'
+/* Transparently support large files, in spirit similar to the POSIX
+   LFS API.  */
+#define stat(fname, buf) _stati64 (fname, buf)
 
-/* Microsoft says stat is _stat, Borland doesn't.  */
-#ifdef _MSC_VER
-# define stat _stat
+#ifndef __BORLANDC__
+# define fstat(fd, buf) _fstati64 (fd, buf)
 #endif
 
+#if defined(_MSC_VER)
+# define struct_stat struct _stati64
+#elif defined(__BORLANDC__)
+# define struct_stat struct stati64
+#else
+# define struct_stat struct stat
+#endif
+
+#define PATH_SEPARATOR '\\'
+
 #ifdef HAVE_ISATTY
-/* Microsoft VC supports _isatty; Borland?  */
 #ifdef _MSC_VER
 # define isatty _isatty
 #endif
 #endif
 
-#define REALCLOSE(x) closesocket (x)
-
 /* #### Do we need this?  */
 #include <direct.h>