]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl: add compatibility for Amiga and GCC 6.5
authorOliver Urbann <oliver.urbann@tu-dortmund.de>
Wed, 18 Nov 2020 18:44:35 +0000 (19:44 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 20 Nov 2020 22:36:51 +0000 (23:36 +0100)
Changes are mainly reordering and adding of includes required
to compile with a more recent version of GCC.

Closes #6220

acinclude.m4
configure.ac
include/curl/curl.h
lib/curl_setup.h
src/tool_homedir.c

index 380a8fffc99a87077d8295d7780e443c4d81b1b5..61ecd4fe14f74fd40598ddf16d63cdf533e0311c 100644 (file)
@@ -1880,11 +1880,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
 #endif
 #endif
 #ifndef HAVE_WINDOWS_H
-#ifdef HAVE_PROTO_BSDSOCKET_H
-#include <proto/bsdsocket.h>
-struct Library *SocketBase = NULL;
-#define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
-#endif
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #elif defined(HAVE_UNISTD_H)
@@ -1893,6 +1888,11 @@ struct Library *SocketBase = NULL;
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
+#ifdef HAVE_PROTO_BSDSOCKET_H
+#include <proto/bsdsocket.h>
+struct Library *SocketBase = NULL;
+#define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
+#endif
 #endif
     ]],[[
       select(0, 0, 0, 0, 0);
@@ -1945,11 +1945,6 @@ struct Library *SocketBase = NULL;
 #endif
 #endif
 #ifndef HAVE_WINDOWS_H
-#ifdef HAVE_PROTO_BSDSOCKET_H
-#include <proto/bsdsocket.h>
-struct Library *SocketBase = NULL;
-#define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
-#endif
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #elif defined(HAVE_UNISTD_H)
@@ -1958,6 +1953,11 @@ struct Library *SocketBase = NULL;
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
+#ifdef HAVE_PROTO_BSDSOCKET_H
+#include <proto/bsdsocket.h>
+struct Library *SocketBase = NULL;
+#define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
+#endif
 #define SELECTCALLCONV
 #endif
 #ifndef HAVE_STRUCT_TIMEVAL
index 1075511c9da42c98df4e65c380e758517f905bd7..39bdb5ef123499e486bc5c4d8d5462c04def07c6 100755 (executable)
@@ -863,14 +863,14 @@ then
   ])
 fi
 
-if test "$HAVE_GETHOSTBYNAME" != "1"
+if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set
 then
   dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
   AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
   AC_LINK_IFELSE([
     AC_LANG_PROGRAM([[
-#include <proto/bsdsocket.h>
-struct Library *SocketBase = NULL;
+  #include <proto/bsdsocket.h>
+  struct Library *SocketBase = NULL;
     ]],[[
       gethostbyname("www.dummysite.com");
     ]])
index 492a71cfe30f28c7539e02560cbaccc218ccc868..a73418dcea0de8ab95bfd4d6aaad3d39ba07b1f3 100644 (file)
@@ -74,7 +74,7 @@
 #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
     defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
     defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
-    defined(__CYGWIN__) || \
+    defined(__CYGWIN__) || defined(AMIGA) || \
    (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
 #include <sys/select.h>
 #endif
index def1317b2918939172537bc541506ba524f10cfc..59fb3fd53f9bf96f4f8b3ff3d2bf168e41354e81 100644 (file)
 #  include <exec/execbase.h>
 #  include <proto/exec.h>
 #  include <proto/dos.h>
+#  include <unistd.h>
 #  ifdef HAVE_PROTO_BSDSOCKET_H
 #    include <proto/bsdsocket.h> /* ensure bsdsocket.library use */
 #    define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
 #  endif
+/*
+ * In clib2 arpa/inet.h warns that some prototypes may clash
+ * with bsdsocket.library. This avoids the definition of those.
+ */
+#  define __NO_NET_API
 #endif
 
 #include <stdio.h>
index 25e13101a364a3007ebc6f17d2446ba3922e1547..632bdcc4fb37cc40a8c49d2b66236bd91abfaa89 100644 (file)
@@ -22,6 +22,7 @@
 #include "tool_setup.h"
 
 #ifdef HAVE_PWD_H
+#  undef __NO_NET_API /* required for building for AmigaOS */
 #  include <pwd.h>
 #endif