diff --git a/acinclude.m4 b/acinclude.m4 index 380a8fffc..61ecd4fe1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1880,11 +1880,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [ #endif #endif #ifndef HAVE_WINDOWS_H -#ifdef HAVE_PROTO_BSDSOCKET_H -#include -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 #elif defined(HAVE_UNISTD_H) @@ -1893,6 +1888,11 @@ struct Library *SocketBase = NULL; #ifdef HAVE_SYS_SOCKET_H #include #endif +#ifdef HAVE_PROTO_BSDSOCKET_H +#include +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 -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 #elif defined(HAVE_UNISTD_H) @@ -1958,6 +1953,11 @@ struct Library *SocketBase = NULL; #ifdef HAVE_SYS_SOCKET_H #include #endif +#ifdef HAVE_PROTO_BSDSOCKET_H +#include +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 diff --git a/configure.ac b/configure.ac index 1075511c9..39bdb5ef1 100755 --- a/configure.ac +++ b/configure.ac @@ -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 -struct Library *SocketBase = NULL; + #include + struct Library *SocketBase = NULL; ]],[[ gethostbyname("www.dummysite.com"); ]]) diff --git a/include/curl/curl.h b/include/curl/curl.h index 492a71cfe..a73418dce 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -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 #endif diff --git a/lib/curl_setup.h b/lib/curl_setup.h index def1317b2..59fb3fd53 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -277,10 +277,16 @@ # include # include # include +# include # ifdef HAVE_PROTO_BSDSOCKET_H # include /* 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 diff --git a/src/tool_homedir.c b/src/tool_homedir.c index 25e13101a..632bdcc4f 100644 --- a/src/tool_homedir.c +++ b/src/tool_homedir.c @@ -22,6 +22,7 @@ #include "tool_setup.h" #ifdef HAVE_PWD_H +# undef __NO_NET_API /* required for building for AmigaOS */ # include #endif