]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
system.h: fix socklen_t, curl_off_t, long long for Classic Mac OS
authorRyan Schmidt <git@ryandesign.com>
Wed, 7 Dec 2022 17:00:41 +0000 (11:00 -0600)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 9 Dec 2022 07:21:15 +0000 (08:21 +0100)
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

include/curl/system.h
lib/config-mac.h

index df69d4f7dd65d34d164b6602ab242c545577eed4..11db51ecf3995255a35869989f2fa432bf74bb16 100644 (file)
 #  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 <ConditionalMacros.h>
+#  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)
index 4a66edf6b724bf796022938505caf480ee53452f..2d3eec3cb89a165e87ff3fce17fb1675f142830b 100644 (file)
 #define OS "mac"
 #endif
 
+#include <ConditionalMacros.h>
+#if TYPE_LONGLONG
+#define HAVE_LONGLONG           1
+#endif
+
 /* Define if you want the built-in manual */
 #define USE_MANUAL              1
 
 #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