Hi

There are some problems building curl/libcurl with more recent AmigaOS
releases, which I've been meaning to raise for a while.  A more random
problem has prompted me to post this now.

There is an issue with conflicting "struct timeval" definitions with
certain OS releases and C libraries, depending on what gets included
when.  It's a minor difference - the OS one is unsigned, whereas the
common structure has signed elements.  If the OS one ends up getting
defined, this causes a timing calculation error in curl.

It's easy enough to resolve this at the curl end, by casting the
potentially errorneous calculation to a signed long (see attachment).

The second issue, which is the long-standing one, is that modern OS
releases and C libraries don't need bsdsocket.library opening
manually, as the C library can handle this.  This means the #ifdef in
amigaos.c/h needs to be revised.  As this is now the odd case, I
suggest adding a check to Configure for the amitcp/socketbasetags.h
header, and only enabling that code if it is present.  Note there is a
select/WaitSelect definition in curl_setup.h, and an Amiga-specific in
tool_operate.c, which also need to be removed (see attachments) if
building using the C library functions.

Lastly, in curl 7.40.0 there is some IPv6 specific code which is
getting compiled in even with IPv6 disabled:
connect.c: In function `singleipconnect':
connect.c:1019: error: `AF_INET6' undeclared (first use in this function)
connect.c:1019: error: (Each undeclared identifier is reported only once
connect.c:1019: error: for each function it appears in.)
make[2]: *** [libcurl_la-connect.lo] Error 1

I don't have any fix for that.

Regards
Chris
--- lib/timeval.c.orig  2015-01-19 18:31:02.436021392 +0000
+++ lib/timeval.c       2015-01-19 18:30:53.552021418 +0000
@@ -110,7 +110,7 @@ struct timeval curlx_tvnow(void)
 long curlx_tvdiff(struct timeval newer, struct timeval older)
 {
   return (newer.tv_sec-older.tv_sec)*1000+
-    (newer.tv_usec-older.tv_usec)/1000;
+    (long)(newer.tv_usec-older.tv_usec)/1000;
 }
 
 /*
--- lib/curl_setup.h    2014-08-25 22:45:11.000000000 +0100
+++ lib/curl_setup.h    2014-12-20 21:35:26.494012868 +0000
@@ -311,7 +311,6 @@
 #    include <exec/execbase.h>
 #    include <proto/exec.h>
 #    include <proto/dos.h>
-#    define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
 #  endif
 #endif
 
--- src/tool_operate.c.old      2012-10-19 21:42:57.000000000 +0100
+++ src/tool_operate.c  2012-10-19 21:43:27.000000000 +0100
@@ -1731,15 +1731,6 @@
           }
         }
 
-#ifdef __AMIGA__
-        if(!res && outs.s_isreg && outs.filename) {
-          /* Set the url (up to 80 chars) as comment for the file */
-          if(strlen(url) > 78)
-            url[79] = '\0';
-          SetComment(outs.filename, url);
-        }
-#endif
-
 #ifdef HAVE_UTIME
         /* File time can only be set _after_ the file has been closed */
         if(!res && config->remote_time && outs.s_isreg && outs.filename) {
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to