From: Ryan Schmidt Date: Wed, 7 Dec 2022 17:00:41 +0000 (-0600) Subject: system.h: fix socklen_t, curl_off_t, long long for Classic Mac OS X-Git-Tag: curl-7_87_0~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac4554870d40ffd5de0a95df162a3a8b6cfcc7aa;p=thirdparty%2Fcurl.git system.h: fix socklen_t, curl_off_t, long long for Classic Mac OS Change "__MWERKS__" to "macintosh". When this block was originally added in 3ac6929 it was probably intended to handle classic Mac OS since the previous classic Mac OS build procedure for curl (which was removed in bf327a9) used Metrowerks CodeWarrior. But there are other classic Mac OS compilers, such as the MPW compilers, that were not handled by this case. For classic Mac OS, CURL_TYPEOF_CURL_SOCKLEN_T needs to match what's provided by the third-party GUSI library, which does not vary by compiler. Meanwhile CodeWarrior works on platforms other than classic Mac OS, and they may need different definitions. Separate blocks could be added later for any of those platforms that curl doesn't already support. Closes #10049 --- diff --git a/include/curl/system.h b/include/curl/system.h index df69d4f7dd..11db51ecf3 100644 --- a/include/curl/system.h +++ b/include/curl/system.h @@ -164,13 +164,22 @@ # endif # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int -#elif defined(__MWERKS__) -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# define CURL_TYPEOF_CURL_SOCKLEN_T int +#elif defined(macintosh) +# include +# if TYPE_LONGLONG +# define CURL_TYPEOF_CURL_OFF_T long long +# define CURL_FORMAT_CURL_OFF_T "lld" +# define CURL_FORMAT_CURL_OFF_TU "llu" +# define CURL_SUFFIX_CURL_OFF_T LL +# define CURL_SUFFIX_CURL_OFF_TU ULL +# else +# define CURL_TYPEOF_CURL_OFF_T long +# define CURL_FORMAT_CURL_OFF_T "ld" +# define CURL_FORMAT_CURL_OFF_TU "lu" +# define CURL_SUFFIX_CURL_OFF_T L +# define CURL_SUFFIX_CURL_OFF_TU UL +# endif +# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int #elif defined(__TANDEM) # if ! defined(__LP64) diff --git a/lib/config-mac.h b/lib/config-mac.h index 4a66edf6b7..2d3eec3cb8 100644 --- a/lib/config-mac.h +++ b/lib/config-mac.h @@ -34,6 +34,11 @@ #define OS "mac" #endif +#include +#if TYPE_LONGLONG +#define HAVE_LONGLONG 1 +#endif + /* Define if you want the built-in manual */ #define USE_MANUAL 1 @@ -77,7 +82,13 @@ #define HAVE_IOCTL_FIONBIO 1 #define SIZEOF_INT 4 +#define SIZEOF_LONG 4 #define SIZEOF_SIZE_T 4 +#ifdef HAVE_LONGLONG +#define SIZEOF_CURL_OFF_T 8 +#else +#define SIZEOF_CURL_OFF_T 4 +#endif #define HAVE_RECV 1 #define RECV_TYPE_ARG1 int