]> granicus.if.org Git - curl/commitdiff
Fix curl_off_t definition for builds done using Sun compilers and a
authorYang Tse <yangsita@gmail.com>
Thu, 2 Apr 2009 18:50:39 +0000 (18:50 +0000)
committerYang Tse <yangsita@gmail.com>
Thu, 2 Apr 2009 18:50:39 +0000 (18:50 +0000)
non-configured libcurl. In this case curl_off_t data type was gated
to the off_t data type which depends on the _FILE_OFFSET_BITS. This
configuration is exactly the unwanted configuration for our curl_off_t
data type which must not depend on such setting. This breaks ABI for
libcurl libraries built with Sun compilers which were built without
having run the configure script with _FILE_OFFSET_BITS different than
64 and using the ILP32 data model.

CHANGES
RELEASE-NOTES
include/curl/curlbuild.h.dist

diff --git a/CHANGES b/CHANGES
index d493e640bb9109c9db81889747208d66bdf1a1e3..5ce29473af3593429e9e119d19f52409806c1a2a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,16 @@
                                   Changelog
 
 
+Yang Tse (2 Apr 2009)
+- Fix curl_off_t definition for builds done using Sun compilers and a
+  non-configured libcurl. In this case curl_off_t data type was gated
+  to the off_t data type which depends on the _FILE_OFFSET_BITS. This
+  configuration is exactly the unwanted configuration for our curl_off_t
+  data type which must not depend on such setting. This breaks ABI for
+  libcurl libraries built with Sun compilers which were built without
+  having run the configure script with _FILE_OFFSET_BITS different than
+  64 and using the ILP32 data model.
+
 Daniel Stenberg (1 Apr 2009)
 - Andre Guibert de Bruet fixed a NULL pointer use in an infof() call if a
   strdup() call failed. 
index d211b2fef2747b5a0670e5fb86f84d01d15eb19a..b3388b219205fec5553035dbe9b7d986aaf2950f 100644 (file)
@@ -24,6 +24,7 @@ This release includes the following bugfixes:
  o missing Curl_read() and write callback result checking in TELNET transfers
  o more ciphers enabled in libcurl built to use NSS
  o properly return an error code in curl_easy_recv
+ o fixed curl_off_t definition for non-configured builds with Sun compilers
 
 This release includes the following known bugs:
 
index 247213cd4a31015fe31011887e167eec01c2192f..bc5950df58e0787f91e4f4da00a73d52977b01eb 100644 (file)
 /* ===================================== */
 
 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-#include <sys/types.h>
-#include <stdint.h>
-
-#  define CURL_TYPEOF_CURL_OFF_T off_t
-#  define CURL_SIZEOF_CURL_OFF_T 8
-#  if defined(__amd64) || defined(__sparcv9)
-#     define CURL_SIZEOF_LONG 8
-#     define CURL_FORMAT_CURL_OFF_T  "ld"
-#     define CURL_FORMAT_CURL_OFF_TU "lu"
-#     define CURL_FORMAT_OFF_T       "%ld"
-#     define CURL_SUFFIX_CURL_OFF_T L
-#     define CURL_SUFFIX_CURL_OFF_TU UL
+#  if defined(_LP64)
+#    define CURL_SIZEOF_LONG        8
+#    define CURL_TYPEOF_CURL_OFF_T  long
+#    define CURL_FORMAT_CURL_OFF_T  "ld"
+#    define CURL_FORMAT_CURL_OFF_TU "lu"
+#    define CURL_FORMAT_OFF_T       "%ld"
+#    define CURL_SIZEOF_CURL_OFF_T  8
+#    define CURL_SUFFIX_CURL_OFF_T  L
+#    define CURL_SUFFIX_CURL_OFF_TU UL
+#  elif defined(__STDC__) && (__STDC__ == 1)
+#    define CURL_SIZEOF_LONG        4
+#    define CURL_TYPEOF_CURL_OFF_T  long
+#    define CURL_FORMAT_CURL_OFF_T  "ld"
+#    define CURL_FORMAT_CURL_OFF_TU "lu"
+#    define CURL_FORMAT_OFF_T       "%ld"
+#    define CURL_SIZEOF_CURL_OFF_T  4
+#    define CURL_SUFFIX_CURL_OFF_T  L
+#    define CURL_SUFFIX_CURL_OFF_TU UL
 #  else
-#     define CURL_SIZEOF_LONG 4
-#     define CURL_FORMAT_CURL_OFF_T  "lld"
-#     define CURL_FORMAT_CURL_OFF_TU "llu"
-#     define CURL_FORMAT_OFF_T       "%lld"
-#     define CURL_SUFFIX_CURL_OFF_T LL
-#     define CURL_SUFFIX_CURL_OFF_TU ULL
+#    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
 #  endif
 
 /* ===================================== */