aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-08-26 01:40:19 +0000
committerYang Tse <yangsita@gmail.com>2008-08-26 01:40:19 +0000
commit3e2487493ef28ea9e44931faffb04e89ed3aae8d (patch)
tree30e40bb35c060ec724fa46ef0ede265881284dfb /lib
parentfdcb0cd2bce920231af8c0218fe48f276817018b (diff)
Use SIZEOF_OFF_T definition from config file
Diffstat (limited to 'lib')
-rw-r--r--lib/progress.c2
-rw-r--r--lib/setup.h26
-rw-r--r--lib/version.c12
3 files changed, 29 insertions, 11 deletions
diff --git a/lib/progress.c b/lib/progress.c
index 939e7dbcf..1c997e04d 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -78,7 +78,7 @@ static char *max5data(curl_off_t bytes, char *max5)
bytes/ONE_MEGABYTE,
(bytes%ONE_MEGABYTE) / (ONE_MEGABYTE/CURL_OFF_T_C(10)) );
-#if CURL_SIZEOF_CURL_OFF_T > 4
+#if (CURL_SIZEOF_CURL_OFF_T > 4)
else if(bytes < CURL_OFF_T_C(10000) * ONE_MEGABYTE)
/* 'XXXXM' is good until we're at 10000MB or above */
diff --git a/lib/setup.h b/lib/setup.h
index 42d6d01af..4268b9bf6 100644
--- a/lib/setup.h
+++ b/lib/setup.h
@@ -302,6 +302,32 @@
# define struct_stat struct stat
#endif
+/*
+ * Default sizeof(off_t) in case it hasn't been defined in config file.
+ */
+
+#ifndef SIZEOF_OFF_T
+# if defined(__VMS) && (defined(__alpha) || defined(__ia64))
+# if defined(_LARGEFILE)
+# define SIZEOF_OFF_T 8
+# endif
+# elif defined(__OS400__) && defined(__ILEC400__)
+# if defined(_LARGE_FILES)
+# define SIZEOF_OFF_T 8
+# endif
+# elif defined(__MVS__) && defined(__IBMC__)
+# if defined(_LP64) || defined(_LARGE_FILES)
+# define SIZEOF_OFF_T 8
+# endif
+# elif defined(__370__) && defined(__IBMC__)
+# if defined(_LP64) || defined(_LARGE_FILES)
+# define SIZEOF_OFF_T 8
+# endif
+# else
+# define SIZEOF_OFF_T 4
+# endif
+#endif
+
/* Below we define some functions. They should
1. close a socket
diff --git a/lib/version.c b/lib/version.c
index 5b9ccca3d..2e8f1b410 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -190,16 +190,8 @@ static curl_version_info_data version_info = {
#ifdef HAVE_SPNEGO
| CURL_VERSION_SPNEGO
#endif
-/*
- * FIXME before 7.19.0 release.
- *
- * libcurl is largefile enabled when (CURL_SIZEOF_CURL_OFF_T > 4) _AND_
- * libcurl has been built with sizeof(system off_t) > 4 or when large
- * file support is available even with sizeof(system off_t) <= 4.
- *
- * Until this is adjusted, only the (CURL_SIZEOF_CURL_OFF_T > 4) check is done.
- */
-#if (CURL_SIZEOF_CURL_OFF_T > 4)
+#if (CURL_SIZEOF_CURL_OFF_T > 4) && \
+ ( (SIZEOF_OFF_T > 4) || defined(USE_WIN32_LARGE_FILES) )
| CURL_VERSION_LARGEFILE
#endif
#if defined(CURL_DOES_CONVERSIONS)