@@ -46,24 +46,43 @@ #ifndef SOCK_CLOEXEC # define SOCK_CLOEXEC 0 #endif -#if defined(OF_MORPHOS) +#if defined(OF_AMIGAOS) +# ifdef OF_AMIGAOS4 +# define __USE_INLINE__ +# endif +# include # include # define closesocket(sock) CloseSocket(sock) # define ioctlsocket(fd, req, arg) IoctlSocket(fd, req, arg) # define hstrerror(err) "unknown (no hstrerror)" # define SOCKET_ERROR -1 +# ifdef OF_MORPHOS typedef uint32_t in_addr_t; +# endif #elif !defined(OF_WINDOWS) && !defined(OF_WII) # define closesocket(sock) close(sock) #endif #ifdef OF_MORPHOS_IXEMUL typedef uint32_t in_addr_t; #endif + +#if defined(OF_AMIGAOS_M68K) +# define select(nfds, readfds, writefds, errorfds, timeout) \ + WaitSelect(nfds, readfds, writefds, errorfds, (struct __timeval *)timeout, \ + NULL) +#elif defined(OF_AMIGAOS4) +# define select(nfds, readfds, writefds, errorfds, timeout) \ + WaitSelect(nfds, readfds, writefds, errorfds, (struct TimeVal *)timeout, \ + NULL) +#elif defined(OF_MORPHOS) +# define select(nfds, readfds, writefds, errorfds, timeout) \ + WaitSelect(nfds, readfds, writefds, errorfds, timeout, NULL) +#endif #ifdef OF_WII # define accept(sock, addr, addrlen) net_accept(sock, addr, addrlen) # define bind(sock, addr, addrlen) net_bind(sock, addr, addrlen) # define closesocket(sock) net_close(sock)