aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt51
-rw-r--r--lib/curl_config.h.cmake3
2 files changed, 10 insertions, 44 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3bfd8e9c..e70afd6c8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -799,50 +799,6 @@ if(NOT HAVE_SIZEOF_SSIZE_T)
endif(NOT HAVE_SIZEOF_SSIZE_T)
# off_t is sized later, after the HAVE_FILE_OFFSET_BITS test
-# Different sizeofs, etc.
-
-# define CURL_SIZEOF_LONG 4
-# define CURL_TYPEOF_CURL_OFF_T long long
-# define CURL_FORMAT_CURL_OFF_T "lld"
-# define CURL_FORMAT_CURL_OFF_TU "llu"
-# define CURL_FORMAT_OFF_T "%lld"
-# define CURL_SIZEOF_CURL_OFF_T 8
-# define CURL_SUFFIX_CURL_OFF_T LL
-# define CURL_SUFFIX_CURL_OFF_TU ULL
-
-set(CURL_SIZEOF_LONG ${SIZEOF_LONG})
-
-if(SIZEOF_LONG EQUAL 8)
- set(CURL_TYPEOF_CURL_OFF_T long)
- set(CURL_SIZEOF_CURL_OFF_T 8)
- set(CURL_FORMAT_CURL_OFF_T "ld")
- set(CURL_FORMAT_CURL_OFF_TU "lu")
- set(CURL_FORMAT_OFF_T "%ld")
- set(CURL_SUFFIX_CURL_OFF_T L)
- set(CURL_SUFFIX_CURL_OFF_TU UL)
-endif(SIZEOF_LONG EQUAL 8)
-
-if(SIZEOF_LONG_LONG EQUAL 8)
- set(CURL_TYPEOF_CURL_OFF_T "long long")
- set(CURL_SIZEOF_CURL_OFF_T 8)
- set(CURL_FORMAT_CURL_OFF_T "lld")
- set(CURL_FORMAT_CURL_OFF_TU "llu")
- set(CURL_FORMAT_OFF_T "%lld")
- set(CURL_SUFFIX_CURL_OFF_T LL)
- set(CURL_SUFFIX_CURL_OFF_TU ULL)
-endif(SIZEOF_LONG_LONG EQUAL 8)
-
-if(NOT CURL_TYPEOF_CURL_OFF_T)
- set(CURL_TYPEOF_CURL_OFF_T ${ssize_t})
- set(CURL_SIZEOF_CURL_OFF_T ${SIZEOF_SSIZE_T})
- # TODO: need adjustment here.
- set(CURL_FORMAT_CURL_OFF_T "ld")
- set(CURL_FORMAT_CURL_OFF_TU "lu")
- set(CURL_FORMAT_OFF_T "%ld")
- set(CURL_SUFFIX_CURL_OFF_T L)
- set(CURL_SUFFIX_CURL_OFF_TU LU)
-endif(NOT CURL_TYPEOF_CURL_OFF_T)
-
if(HAVE_SIZEOF_LONG_LONG)
set(HAVE_LONGLONG 1)
set(HAVE_LL 1)
@@ -1011,6 +967,13 @@ if(HAVE_FILE_OFFSET_BITS)
set(CMAKE_REQUIRED_FLAGS "-D_FILE_OFFSET_BITS=64")
endif(HAVE_FILE_OFFSET_BITS)
check_type_size("off_t" SIZEOF_OFF_T)
+
+# include this header to get the type
+set(CMAKE_REQUIRED_INCLUDES "${CURL_SOURCE_DIR}/include")
+set(CMAKE_EXTRA_INCLUDE_FILES "curl/system.h")
+check_type_size("curl_off_t" SIZEOF_CURL_OFF_T)
+set(CMAKE_EXTRA_INCLUDE_FILES "")
+
set(CMAKE_REQUIRED_FLAGS)
foreach(CURL_TEST
diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake
index c2b5bacb9..c80484f65 100644
--- a/lib/curl_config.h.cmake
+++ b/lib/curl_config.h.cmake
@@ -888,6 +888,9 @@
/* The size of `off_t', as computed by sizeof. */
#cmakedefine SIZEOF_OFF_T ${SIZEOF_OFF_T}
+/* The size of `curl_off_t', as computed by sizeof. */
+#cmakedefine SIZEOF_CURL_OFF_T ${SIZEOF_CURL_OFF_T}
+
/* The size of `size_t', as computed by sizeof. */
#cmakedefine SIZEOF_SIZE_T ${SIZEOF_SIZE_T}