0001-curl-system.h-support-more-architectures.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 7d84bd820ef412d251b643a4faced105668f4ebd Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Fri, 11 Aug 2017 18:52:37 +0200
  4. Subject: [PATCH] curl/system.h: support more architectures
  5. The long list of architectures in include/curl/system.h is annoying to
  6. maintain, and needs to be extended for each and every architecture to
  7. support.
  8. Instead, let's rely on the __SIZEOF_LONG__ define of the gcc compiler
  9. (we are in the GNUC condition anyway), which tells us if long is 4
  10. bytes or 8 bytes.
  11. This fixes the build of libcurl 7.55.0 on architectures such as
  12. OpenRISC or ARC.
  13. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  14. ---
  15. include/curl/system.h | 5 +++--
  16. 1 file changed, 3 insertions(+), 2 deletions(-)
  17. diff --git a/include/curl/system.h b/include/curl/system.h
  18. index 79abf8f..0e13075 100644
  19. --- a/include/curl/system.h
  20. +++ b/include/curl/system.h
  21. @@ -403,7 +403,7 @@
  22. # if !defined(__LP64__) && (defined(__ILP32__) || \
  23. defined(__i386__) || defined(__ppc__) || defined(__arm__) || \
  24. defined(__sparc__) || defined(__mips__) || defined(__sh__) || \
  25. - defined(__XTENSA__))
  26. + defined(__XTENSA__) || (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4))
  27. # define CURL_SIZEOF_LONG 4
  28. # define CURL_TYPEOF_CURL_OFF_T long long
  29. # define CURL_FORMAT_CURL_OFF_T "lld"
  30. @@ -412,7 +412,8 @@
  31. # define CURL_SUFFIX_CURL_OFF_T LL
  32. # define CURL_SUFFIX_CURL_OFF_TU ULL
  33. # elif defined(__LP64__) || \
  34. - defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__)
  35. + defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
  36. + (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8)
  37. # define CURL_SIZEOF_LONG 8
  38. # define CURL_TYPEOF_CURL_OFF_T long
  39. # define CURL_FORMAT_CURL_OFF_T "ld"
  40. --
  41. 2.9.4