aboutsummaryrefslogtreecommitdiff
path: root/src/setup.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/setup.h')
-rw-r--r--src/setup.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/setup.h b/src/setup.h
index c7e7cf98e..414aac73b 100644
--- a/src/setup.h
+++ b/src/setup.h
@@ -158,6 +158,43 @@
#include <floss.h>
#endif
+/*
+ * Large file (>2Gb) support using WIN32 functions.
+ */
+
+#ifdef USE_WIN32_LARGE_FILES
+# include <io.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence)
+# define fstat(fdes,stp) _fstati64(fdes, stp)
+# define stat(fname,stp) _stati64(fname, stp)
+# define struct_stat struct _stati64
+# define LSEEK_ERROR (__int64)-1
+#endif
+
+/*
+ * Small file (<2Gb) support using WIN32 functions.
+ */
+
+#ifdef USE_WIN32_SMALL_FILES
+# include <io.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# define lseek(fdes,offset,whence) _lseek(fdes, (long)offset, whence)
+# define fstat(fdes,stp) _fstat(fdes, stp)
+# define stat(fname,stp) _stat(fname, stp)
+# define struct_stat struct _stat
+# define LSEEK_ERROR (long)-1
+#endif
+
+#ifndef struct_stat
+# define struct_stat struct stat
+#endif
+
+#ifndef LSEEK_ERROR
+# define LSEEK_ERROR (off_t)-1
+#endif
#ifndef OS
#define OS "unknown"
@@ -254,3 +291,4 @@ int fileno( FILE *stream);
#endif
#endif /* HEADER_CURL_SRC_SETUP_H */
+