As promised, the small patches needed for PL14 on MacOS. A README.MAC is forthcoming, hopefully by the end of the week. comm.c : 1) MacOS can handle some signals, but not all. I moved the appropriate #ifdef around. 2) The GUSI sockets library is derived from BSD, so it defines SO_LINGER, even though setsockopt() is unimplimented. 3) The third parameter to accept() should be int. sysdep.h : 1) define socket_t and CLOSE_SOCK() 2) add fdopen() prototype inside an appropriate #ifdef conf.h.mac : adds a #define NEED_FDOPEN_PROTO for above. No idea if any other systems need it, but this is the consistant way of adding this support. Note, the conf.h.mac here is minimalist on purpose - to avoid spamming the list with a hundred more lines of #undefs. The appropriate conf.h.mac would derive from conf.h.in. --- comm.c.orig Sat Jul 4 12:29:58 1998 +++ comm.c Sun Jul 5 07:44:56 1998 @@ -314,7 +314,7 @@ boot_db(); -#ifdef CIRCLE_UNIX +#if defined (CIRCLE_UNIX) || defined(CIRCLE_MACINTOSH) log("Signal trapping."); signal_setup(); #endif @@ -401,7 +401,7 @@ set_sendbuf(s); -#if defined(SO_LINGER) +#if defined(SO_LINGER) && !defined(CIRCLE_MACINTOSH) { struct linger ld; @@ -1165,7 +1165,7 @@ { socket_t desc; int sockets_connected = 0; - unsigned int i; + int i; static int last_desc = 0; /* last descriptor number */ struct descriptor_data *newd; struct sockaddr_in peer; @@ -1923,6 +1923,8 @@ tics = 0; } +#endif /* CIRCLE_UNIX */ + RETSIGTYPE hupsig(int sig) { log("SYSERR: Received SIGHUP, SIGINT, or SIGTERM. Shutting down..."); @@ -2003,7 +2005,6 @@ my_signal(SIGALRM, SIG_IGN); } -#endif /* CIRCLE_UNIX */ #endif /* CIRCLE_UNIX || CIRCLE_MACINTOSH */ /* **************************************************************** --- sysdep.h.orig Wed Mar 4 21:37:18 1998 +++ sysdep.h Sun Jul 5 07:32:10 1998 @@ -284,6 +284,8 @@ # define CLOSE_SOCKET(sock) close(sock) #elif defined(CIRCLE_MACINTOSH) /* Macintosh definitions. */ + typedef int socket_t; +# define CLOSE_SOCKET(sock) close(sock) #elif defined(CIRCLE_ACORN) /* Definitions for Acorn. */ typedef int socket_t; @@ -383,6 +385,10 @@ #ifdef NEED_FCLOSE_PROTO int fclose(FILE *stream); +#endif + +#ifdef NEED_FDOPEN_PROTO + FILE *fdopen(int fd, const char *mode); #endif #ifdef NEED_FFLUSH_PROTO /* * conf.h.mac : This is a minimal file to #define the symbols needed to * compile Circle 3.0 bPL14 for MacOS with CodeWarrior Pro2 * and the GUSI 1.8.3 library. * * The comments and unneeded #undefs were removed to make * it short enough to post to the mailing list. * * A distribution copy of this file should include all the * #define/#undef lines to make it easy to tweak for different * compiler/library versions. */ #define CIRCLE_MACINTOSH 1 #undef CIRCLE_UNIX #undef CIRCLE_WINDOWS #undef CIRCLE_AMIGA #undef CIRCLE_ACORN #undef CIRCLE_OS2 #define HAVE_SYS_ERRNO_H 1 #define RETSIGTYPE void #define STDC_HEADERS 1 #define TIME_WITH_SYS_TIME 1 #define HAVE_ASSERT_H 1 #define HAVE_FCNTL_H 1 #define HAVE_LIMITS_H 1 #define HAVE_MEMORY_H 1 #define HAVE_NETDB_H 1 #define HAVE_NETINET_IN_H 1 #define HAVE_SIGNAL_H #define HAVE_STRING_H 1 #define HAVE_STRINGS_H 1 #define HAVE_SYS_ERNO_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_SOCKET_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_TIME_H 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_UNISTD_H 1 #define NEED_FDOPEN_PROTO 1 #define NEED_INET_NTOA_PROTO 1 +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST