]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
amissl: allow AmiSSL to be used with AmigaOS 4.x builds
authorFutaura <oliver@futaura.co.uk>
Sun, 7 Aug 2022 16:04:47 +0000 (17:04 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 8 Aug 2022 08:48:11 +0000 (10:48 +0200)
Enable AmiSSL to be used instead of static OpenSSL link libraries.
for AmigaOS 4.x, as it already is in the AmigaOS 3.x build.

Closes #9269

lib/amigaos.c
lib/curl_setup.h

index d76f5b03fd0994502abfd56d99fa698c851f6572..d26cd1da18a414094a68ab604e57bd555a8978d8 100644 (file)
 #include "memdebug.h"
 
 #ifdef __AMIGA__
-#if defined(HAVE_PROTO_BSDSOCKET_H) && !defined(USE_AMISSL)
+
+#ifdef __amigaos4__
+
+#ifdef USE_AMISSL
+int Curl_amiga_select(int nfds, fd_set *readfds, fd_set *writefds,
+                      fd_set *errorfds, struct timeval *timeout)
+{
+  int r = WaitSelect(nfds, readfds, writefds, errorfds, timeout, 0);
+  /* Ensure Ctrl-C signal is actioned */
+  if((r == -1) && (SOCKERRNO == EINTR))
+    raise(SIGINT);
+  return r;
+}
+#endif /* USE_AMISSL */
+
+#elif defined(HAVE_PROTO_BSDSOCKET_H) && !defined(USE_AMISSL)
 struct Library *SocketBase = NULL;
 extern int errno, h_errno;
 
index 4286dcfa9553607dbfe947a69c802f31999ecce5..85d586180ecce89045c4607a941e08f3388d6a17 100644 (file)
 #  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)
+#  if defined(HAVE_PROTO_BSDSOCKET_H) && \
+    (!defined(__amigaos4__) || defined(USE_AMISSL))
+     /* use bsdsocket.library directly, instead of libc networking functions */
+#    include <proto/bsdsocket.h>
+#    ifdef __amigaos4__
+       int Curl_amiga_select(int nfds, fd_set *readfds, fd_set *writefds,
+                             fd_set *errorfds, struct timeval *timeout);
+#      define select(a,b,c,d,e) Curl_amiga_select(a,b,c,d,e)
+#    else
+#      define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
+#    endif
+     /* must not use libc's fcntl() on bsdsocket.library sockfds! */
+#    undef HAVE_FCNTL
+#    undef HAVE_FCNTL_O_NONBLOCK
+#  else
+     /* use libc networking and hence close() and fnctl() */
+#    undef HAVE_CLOSESOCKET_CAMEL
+#    undef HAVE_IOCTLSOCKET_CAMEL
 #  endif
 /*
  * In clib2 arpa/inet.h warns that some prototypes may clash