Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patches for solaris.



I think these fixes is needed in order to make crossfire work better on
solaris systems.

The SOLARIS2_1 define is not needed since X should be bootstraped
with SVR4, and the compiler defined __sun__.

I have also added quite a few missing header files.

Another thing is that you should never, never, never use the ucb library
that sun delivers with SunOS 5.*

Another change I'd like to see is that my name is spelled right.
My lastname is spelled with an ISO-8859/1 oslash and not an 'o'.

Kjetil

diff -cr crossfire-0.90.2.orig/client/Imakefile crossfire-0.90.2/client/Imakefile
*** crossfire-0.90.2.orig/client/Imakefile	Mon Mar  7 07:57:46 1994
--- crossfire-0.90.2/client/Imakefile	Tue Mar  8 17:23:40 1994
***************
*** 32,39 ****
  #endif
  
  /* LOCAL_LDFLAGS = -L../common /* SGI doesn't understand this... */
- /* if SOLARIS2_1: -lsocket */
- /* LOCAL_LIBRARIES = -L../common -lcross -lX11 -lsocket */
  LOCAL_LIBRARIES = -L../common -lcross $(XPM_LIB) $(XLIB)
  
  #ifdef OSFArchitecture
--- 32,37 ----
diff -cr crossfire-0.90.2.orig/client/client.c crossfire-0.90.2/client/client.c
*** crossfire-0.90.2.orig/client/client.c	Mon Mar  7 07:57:46 1994
--- crossfire-0.90.2/client/client.c	Wed Mar  9 14:42:14 1994
***************
*** 31,36 ****
--- 31,37 ----
  #include <string.h>
  #include <ctype.h>
  #include <sys/types.h>
+ #include <unistd.h>
  #include <sys/time.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
***************
*** 234,244 ****
        fprintf(stderr,"Unknown host: %s\n",hostname);
        return 1;
      }
- #ifdef SOLARIS2_1
      memcpy(&insock.sin_addr, hostbn->h_addr, hostbn->h_length);
- #else
-     bcopy(hostbn->h_addr, &insock.sin_addr, hostbn->h_length);
- #endif
      sprintf(buf,"xhost +%s",hostbn->h_name);
    }
    if (optcmd == (char *) NULL)
--- 235,241 ----
diff -cr crossfire-0.90.2.orig/common/living.c crossfire-0.90.2/common/living.c
*** crossfire-0.90.2.orig/common/living.c	Mon Mar  7 07:57:23 1994
--- crossfire-0.90.2/common/living.c	Wed Mar  9 13:43:48 1994
***************
*** 25,30 ****
--- 25,31 ----
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
  
+ #include <stdlib.h>
  #include <global.h>
  #include <living.h>
  #include <funcpoint.h>
diff -cr crossfire-0.90.2.orig/common/loader.c crossfire-0.90.2/common/loader.c
*** crossfire-0.90.2.orig/common/loader.c	Mon Mar  7 07:57:23 1994
--- crossfire-0.90.2/common/loader.c	Wed Mar  9 13:44:03 1994
***************
*** 29,34 ****
--- 29,35 ----
     sub/add_weight will transcend the environment updating the carrying
     variable. */
  
+ #include <stdlib.h>
  #include <global.h>
  #include <loader.h>
  #include <graphics.h>
diff -cr crossfire-0.90.2.orig/common/logger.c crossfire-0.90.2/common/logger.c
*** crossfire-0.90.2.orig/common/logger.c	Mon Mar  7 07:57:23 1994
--- crossfire-0.90.2/common/logger.c	Wed Mar  9 13:44:56 1994
***************
*** 27,32 ****
--- 27,33 ----
  
  #ifndef NO_LOG
  
+ #include <unistd.h>
  #include <stdarg.h>
  #include <global.h>
  #include <funcpoint.h>
diff -cr crossfire-0.90.2.orig/common/map.c crossfire-0.90.2/common/map.c
*** crossfire-0.90.2.orig/common/map.c	Mon Mar  7 07:57:23 1994
--- crossfire-0.90.2/common/map.c	Wed Mar  9 13:48:19 1994
***************
*** 25,35 ****
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
  
  #include <global.h>
  #include <funcpoint.h>
  
  #ifdef NeXT
! extern char *tempnam(char *dir, char *pfx);
  #endif
  
  extern int nrofallocobjects,nroffreeobjects;
--- 25,38 ----
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
  
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <unistd.h>
  #include <global.h>
  #include <funcpoint.h>
  
  #ifdef NeXT
! char *tempnam(char *, char *);
  #endif
  
  extern int nrofallocobjects,nroffreeobjects;
diff -cr crossfire-0.90.2.orig/common/object.c crossfire-0.90.2/common/object.c
*** crossfire-0.90.2.orig/common/object.c	Mon Mar  7 07:57:23 1994
--- crossfire-0.90.2/common/object.c	Wed Mar  9 13:48:51 1994
***************
*** 31,36 ****
--- 31,37 ----
  
  #include <stdio.h>
  #include <sys/types.h>
+ #include <stdlib.h>
  #include <sys/uio.h>
  #include <global.h>
  #include <graphics.h>
diff -cr crossfire-0.90.2.orig/common/time.c crossfire-0.90.2/common/time.c
*** crossfire-0.90.2.orig/common/time.c	Mon Mar  7 07:57:24 1994
--- crossfire-0.90.2/common/time.c	Wed Mar  9 14:48:54 1994
***************
*** 31,36 ****
--- 31,40 ----
  #include <global.h>
  #include <funcpoint.h>
  
+ #if defined(SVR4) && defined(__sun__)
+ int gettimeofday(struct timeval *);
+ #endif
+ 
  /*
   * Gloabal variables:
   */
***************
*** 65,71 ****
--- 69,79 ----
    process_tot_mtime = 0;
    pticks = 0;
  #endif
+ #if defined(SVR4) && defined(__sun__)
+   (void) gettimeofday(&last_time);
+ #else
    (void) gettimeofday(&last_time, (struct timezone *) NULL);
+ #endif
  }
  
  void
***************
*** 95,101 ****
--- 103,113 ----
    static struct timeval new_time;
    long elapsed_utime;
  
+ #if defined(SVR4) && defined(__sun__)
+   (void) gettimeofday(&new_time);
+ #else
    (void) gettimeofday(&new_time, (struct timezone *) NULL);
+ #endif
    elapsed_utime = (new_time.tv_sec - last_time.tv_sec) * 1000000 +
                    new_time.tv_usec - last_time.tv_usec;
    if (elapsed_utime > max_time) {
***************
*** 120,126 ****
--- 132,142 ----
    static struct timeval new_time;
    long sleep_sec, sleep_usec;
  
+ #if defined(SVR4) && defined(__sun__)
+   (void) gettimeofday(&new_time);
+ #else
    (void) gettimeofday(&new_time, (struct timezone *) NULL);
+ #endif
    sleep_sec = last_time.tv_sec - new_time.tv_sec;
    sleep_usec = max_time - (new_time.tv_usec - last_time.tv_usec);
  
***************
*** 221,226 ****
--- 237,246 ----
  {
    struct timeval now;
  
+ #if defined(SVR4) && defined(__sun__)
+   (void) gettimeofday(&now);
+ #else
    (void) gettimeofday(&now, (struct timezone *) 0);
+ #endif
    return now.tv_sec;
  }
diff -cr crossfire-0.90.2.orig/common/treasure.c crossfire-0.90.2/common/treasure.c
*** crossfire-0.90.2.orig/common/treasure.c	Mon Mar  7 07:57:24 1994
--- crossfire-0.90.2/common/treasure.c	Wed Mar  9 13:51:24 1994
***************
*** 27,32 ****
--- 27,33 ----
  
  #define ALLOWED_COMBINATION
  
+ #include <stdlib.h>
  #include <global.h>
  #include <treasure.h>
  #include <spellist.h>
diff -cr crossfire-0.90.2.orig/config/crossfire.cf crossfire-0.90.2/config/crossfire.cf
*** crossfire-0.90.2.orig/config/crossfire.cf	Mon Mar  7 07:58:14 1994
--- crossfire-0.90.2/config/crossfire.cf	Wed Mar  9 15:25:28 1994
***************
*** 92,98 ****
   * On anything except sun and hp, the lines should ideally stay commented out.
   */
  #ifndef ForceCC
! #ifdef SunArchitecture
  #ifdef SunHasAcc
  CC = acc
  CCOPTIONS = -Xc
--- 92,98 ----
   * On anything except sun and hp, the lines should ideally stay commented out.
   */
  #ifndef ForceCC
! #if defined(SunArchitecture) && !(OSMajorVersion == 5)
  #ifdef SunHasAcc
  CC = acc
  CCOPTIONS = -Xc
diff -cr crossfire-0.90.2.orig/config/crosssite.def crossfire-0.90.2/config/crosssite.def
*** crossfire-0.90.2.orig/config/crosssite.def	Mon Mar  7 07:58:14 1994
--- crossfire-0.90.2/config/crosssite.def	Wed Mar  9 15:25:15 1994
***************
*** 111,119 ****
--- 111,121 ----
   * define/undef above is set correctly, so that the user does not
   * need to set these manually.
   */
+ #if defined(SunArchitecture) && !(OSMajorVersion == 5)
  #ifndef SunHasAcc
  #define StupidSunHeaders
  #endif
+ #endif
  
  /* Only Suns with acc seem to have problems with longjump */
  #ifdef SunHasAcc
diff -cr crossfire-0.90.2.orig/include/sproto.h crossfire-0.90.2/include/sproto.h
*** crossfire-0.90.2.orig/include/sproto.h	Mon Mar  7 07:58:12 1994
--- crossfire-0.90.2/include/sproto.h	Tue Mar  8 17:54:24 1994
***************
*** 185,190 ****
--- 185,191 ----
  extern int command_rotateinventory ( object *op, char *params );
  extern int command_invisible ( object *op, char *params );
  extern int command_rotateshoottype ( object *op, char *params );
+ int command_search ( object *, char *);
  extern int command_show ( object *op, char *params );
  extern int command_throw ( object *op, char *params );
  extern int command_brace ( object *op, char *params );
diff -cr crossfire-0.90.2.orig/include/sunos.h crossfire-0.90.2/include/sunos.h
*** crossfire-0.90.2.orig/include/sunos.h	Mon Mar  7 07:58:12 1994
--- crossfire-0.90.2/include/sunos.h	Tue Mar  8 17:12:01 1994
***************
*** 1,3 ****
--- 1,4 ----
+ #ifndef SVR4
  /*
   * static char *rcsid_sunos_h =
   *   "$Id: sunos.h,v 1.10 1994/02/12 05:17:37 master Exp $";
***************
*** 105,111 ****
  int ioctl();
  int setpgrp();
  
- #ifndef SOLARIS2_1
  int printf();
  int fprintf();
  int fscanf();
--- 106,111 ----
diff -cr crossfire-0.90.2.orig/server/Imakefile crossfire-0.90.2/server/Imakefile
*** crossfire-0.90.2.orig/server/Imakefile	Mon Mar  7 07:57:40 1994
--- crossfire-0.90.2/server/Imakefile	Wed Mar  9 15:07:17 1994
***************
*** 42,53 ****
  XPM_LIBS =  -L$(XPM_LIBDIR) -lXpm
  #endif
  
! #ifdef SOLARIS2_1
! SOLARIS_LIBS = -lnsl -lsocket -lc -lucb -lelf
! #endif
! 
! LOCAL_LIBRARIES = $(SOUND_LIBS) $(MALLOC_LIBS) $(XPM_LIBS) -L../common \
! 	-lcross $(XLIB) $(SOLARIS_LIBS)
  
  /* I guess the make on OSF systems can handle constructs where the
   * variable is being set to itself?  Gnu make and sun make can't seem
--- 42,49 ----
  XPM_LIBS =  -L$(XPM_LIBDIR) -lXpm
  #endif
  
! LOCAL_LIBRARIES = $(SOUND_LIBS) $(MALLOC_LIBS) -L../common -lcross \
! 	$(XPM_LIBS) $(XLIB)
  
  /* I guess the make on OSF systems can handle constructs where the
   * variable is being set to itself?  Gnu make and sun make can't seem
diff -cr crossfire-0.90.2.orig/server/apply.c crossfire-0.90.2/server/apply.c
*** crossfire-0.90.2.orig/server/apply.c	Mon Mar  7 07:57:40 1994
--- crossfire-0.90.2/server/apply.c	Wed Mar  9 13:52:58 1994
***************
*** 25,30 ****
--- 25,34 ----
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
  
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <signal.h>
+ #include <unistd.h>
  #include <global.h>
  #include <living.h>
  #include <spells.h>
diff -cr crossfire-0.90.2.orig/server/attack.c crossfire-0.90.2/server/attack.c
*** crossfire-0.90.2.orig/server/attack.c	Mon Mar  7 07:57:40 1994
--- crossfire-0.90.2/server/attack.c	Wed Mar  9 13:53:29 1994
***************
*** 23,28 ****
--- 23,29 ----
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
+ #include <stdlib.h>
  #include <global.h>
  #include <graphics.h>
  #include <living.h>
diff -cr crossfire-0.90.2.orig/server/c_object.c crossfire-0.90.2/server/c_object.c
*** crossfire-0.90.2.orig/server/c_object.c	Mon Mar  7 07:57:40 1994
--- crossfire-0.90.2/server/c_object.c	Wed Mar  9 14:39:06 1994
***************
*** 3,8 ****
--- 3,9 ----
   *	++Jam & Anipa
   */
  
+ #include <string.h>
  #include <global.h>
  #include <loader.h>
  #include <input.h>
diff -cr crossfire-0.90.2.orig/server/daemon.c crossfire-0.90.2/server/daemon.c
*** crossfire-0.90.2.orig/server/daemon.c	Mon Mar  7 07:57:41 1994
--- crossfire-0.90.2/server/daemon.c	Wed Mar  9 15:16:51 1994
***************
*** 29,34 ****
--- 29,36 ----
   */
  
  
+ #include <sys/types.h>
+ #include <unistd.h>
  #include <global.h>
  #include <sys/ioctl.h>
  #ifdef hpux
***************
*** 88,94 ****
  	(void) ioctl (i, TIOCTTY, &zero);
  #else
  #ifndef TIOCNOTTY /********* !!!!!!!!! **********/
! #ifdef SOLARIS2_1
  #include <sys/termios.h>
  #else
  #include <sys/ttycom.h>
--- 90,96 ----
  	(void) ioctl (i, TIOCTTY, &zero);
  #else
  #ifndef TIOCNOTTY /********* !!!!!!!!! **********/
! #if defined(SVR4) && defined(__sun__)
  #include <sys/termios.h>
  #else
  #include <sys/ttycom.h>
***************
*** 104,110 ****
--- 106,116 ----
  #if defined(hpux) || defined(sgi) /* Added sgi. -Frank */
      setsid();
  #else
+ #if defined(SVR4) && defined(__sun__)
+     setpgrp();
+ #else
      setpgrp (0, 0);
+ #endif /* !SVR4 && !__sun__ */
  #endif
  #else
      setpgrp (0, getpid());
diff -cr crossfire-0.90.2.orig/server/encounter.c crossfire-0.90.2/server/encounter.c
*** crossfire-0.90.2.orig/server/encounter.c	Mon Mar  7 07:57:41 1994
--- crossfire-0.90.2/server/encounter.c	Wed Mar  9 13:56:18 1994
***************
*** 24,29 ****
--- 24,30 ----
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
  
+ #include <stdlib.h>
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
diff -cr crossfire-0.90.2.orig/server/init.c crossfire-0.90.2/server/init.c
*** crossfire-0.90.2.orig/server/init.c	Mon Mar  7 07:57:41 1994
--- crossfire-0.90.2/server/init.c	Wed Mar  9 13:57:12 1994
***************
*** 25,31 ****
  
      The author can be reached via e-mail to master@rahul.net
  */
! 
  #include <global.h>
  #include <loader.h>
  #include <main.h>
--- 25,32 ----
  
      The author can be reached via e-mail to master@rahul.net
  */
! #include <stdlib.h>
! #include <unistd.h>
  #include <global.h>
  #include <loader.h>
  #include <main.h>
diff -cr crossfire-0.90.2.orig/server/input.c crossfire-0.90.2/server/input.c
*** crossfire-0.90.2.orig/server/input.c	Mon Mar  7 07:57:41 1994
--- crossfire-0.90.2/server/input.c	Wed Mar  9 13:57:37 1994
***************
*** 25,30 ****
--- 25,31 ----
      The author can be reached via e-mail to master@rahul.net
  */
  
+ #include <string.h>
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
diff -cr crossfire-0.90.2.orig/server/invoke.c crossfire-0.90.2/server/invoke.c
*** crossfire-0.90.2.orig/server/invoke.c	Mon Mar  7 07:57:41 1994
--- crossfire-0.90.2/server/invoke.c	Wed Mar  9 13:57:59 1994
***************
*** 25,31 ****
  
      The author can be reached via e-mail to master@rahul.net
  */
! 
  #include <graphics.h>
  #include <global.h>
  #ifndef __CEXTRACT__
--- 25,31 ----
  
      The author can be reached via e-mail to master@rahul.net
  */
! #include <stdlib.h>
  #include <graphics.h>
  #include <global.h>
  #ifndef __CEXTRACT__
diff -cr crossfire-0.90.2.orig/server/login.c crossfire-0.90.2/server/login.c
*** crossfire-0.90.2.orig/server/login.c	Mon Mar  7 07:57:42 1994
--- crossfire-0.90.2/server/login.c	Wed Mar  9 13:59:18 1994
***************
*** 25,30 ****
--- 25,33 ----
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
  
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
diff -cr crossfire-0.90.2.orig/server/main.c crossfire-0.90.2/server/main.c
*** crossfire-0.90.2.orig/server/main.c	Mon Mar  7 07:57:42 1994
--- crossfire-0.90.2/server/main.c	Wed Mar  9 15:23:35 1994
***************
*** 26,31 ****
--- 26,35 ----
      The author can be reached via e-mail to master@rahul.net
  */
  
+ #include <stdlib.h>
+ #if ((defined(__sun__) || defined(__sgi)) && defined(SVR4)) || defined(__osf__)
+ #include <crypt.h>
+ #endif
  #include <version.h>
  #include <global.h>
  #ifndef __CEXTRACT__
***************
*** 133,142 ****
    else
      s[0]= salt[0],
      s[1]= salt[1];
! #ifdef __sun__
!   return _crypt(str,s);
!  #else
!   return ((char *) crypt(str,s));
! #endif
  }
  
--- 137,147 ----
    else
      s[0]= salt[0],
      s[1]= salt[1];
!   return crypt(str,s);
  }
  
diff -cr crossfire-0.90.2.orig/server/monster.c crossfire-0.90.2/server/monster.c
*** crossfire-0.90.2.orig/server/monster.c	Mon Mar  7 07:57:42 1994
--- crossfire-0.90.2/server/monster.c	Wed Mar  9 14:00:19 1994
***************
*** 24,30 ****
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
! 
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
--- 24,30 ----
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
! #include <stdlib.h>
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
diff -cr crossfire-0.90.2.orig/server/move.c crossfire-0.90.2/server/move.c
*** crossfire-0.90.2.orig/server/move.c	Mon Mar  7 07:57:42 1994
--- crossfire-0.90.2/server/move.c	Wed Mar  9 14:00:36 1994
***************
*** 24,30 ****
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
! 
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
--- 24,30 ----
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
! #include <stdlib.h>
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
diff -cr crossfire-0.90.2.orig/server/newspells.c crossfire-0.90.2/server/newspells.c
*** crossfire-0.90.2.orig/server/newspells.c	Mon Mar  7 07:57:42 1994
--- crossfire-0.90.2/server/newspells.c	Wed Mar  9 14:00:53 1994
***************
*** 25,31 ****
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
! 
  #include <graphics.h>
  #include <global.h>
  #ifndef __CEXTRACT__
--- 25,31 ----
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
! #include <stdlib.h>
  #include <graphics.h>
  #include <global.h>
  #ifndef __CEXTRACT__
diff -cr crossfire-0.90.2.orig/server/pets.c crossfire-0.90.2/server/pets.c
*** crossfire-0.90.2.orig/server/pets.c	Mon Mar  7 07:57:42 1994
--- crossfire-0.90.2/server/pets.c	Wed Mar  9 14:01:09 1994
***************
*** 24,30 ****
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
! 
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
--- 24,30 ----
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
! #include <stdlib.h>
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
diff -cr crossfire-0.90.2.orig/server/player.c crossfire-0.90.2/server/player.c
*** crossfire-0.90.2.orig/server/player.c	Mon Mar  7 07:57:42 1994
--- crossfire-0.90.2/server/player.c	Wed Mar  9 14:41:27 1994
***************
*** 24,30 ****
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
! 
  #include <pwd.h>
  #include <graphics.h>
  #include <global.h>
--- 24,32 ----
  
      The author can be reached via e-mail to frankj@ifi.uio.no.
  */
! #include <stdlib.h>
! #include <sys/types.h>
! #include <unistd.h>
  #include <pwd.h>
  #include <graphics.h>
  #include <global.h>
***************
*** 1738,1745 ****
    object *tmp;
    int last_food=op->stats.food;
    int gen_hp, gen_sp;
!   int x,y;  /*  these are for resurrection */
!   mapstruct *map;  /*  this is for resurrection */
  
    if(!op->contr->state) {
      gen_hp=(op->contr->gen_hp+1)*op->stats.maxhp;
--- 1751,1758 ----
    object *tmp;
    int last_food=op->stats.food;
    int gen_hp, gen_sp;
!   int x = 0, y = 0;  /*  these are for resurrection */
!   mapstruct *map = NULL;  /*  this is for resurrection */
  
    if(!op->contr->state) {
      gen_hp=(op->contr->gen_hp+1)*op->stats.maxhp;
***************
*** 1980,1999 ****
      if(!QUERY_FLAG(op,FLAG_WAS_WIZ)&&op->stats.exp) {
        delete_character(op->name);
  #ifndef NOT_PERMADEATH
!         int tempx, tempy;
!         /* save playerfile sans equipment when player dies
!         ** then save it as player.pl.dead so that future resurrection
!         ** type spells will work on them nicely
!         */
!         op->stats.hp = op->stats.maxhp;
!         op->stats.food = 999;
!         if(op->map!=NULL)
!               strcpy(op->map->path, EMERGENCY_MAPPATH);
!         op->x = EMERGENCY_X;
!         op->y = EMERGENCY_Y;
!         save_player(op,0);
!         /* please see resurrection.c: peterm */
!         dead_player(op);
  #endif
      }
      remove_lock(op->contr);
--- 1993,2011 ----
      if(!QUERY_FLAG(op,FLAG_WAS_WIZ)&&op->stats.exp) {
        delete_character(op->name);
  #ifndef NOT_PERMADEATH
!       /* save playerfile sans equipment when player dies
!        ** then save it as player.pl.dead so that future resurrection
!        ** type spells will work on them nicely
!        */
!       op->stats.hp = op->stats.maxhp;
!       op->stats.food = 999;
!       if(op->map!=NULL)
! 	strcpy(op->map->path, EMERGENCY_MAPPATH);
!       op->x = EMERGENCY_X;
!       op->y = EMERGENCY_Y;
!       save_player(op,0);
!       /* please see resurrection.c: peterm */
!       dead_player(op);
  #endif
      }
      remove_lock(op->contr);
diff -cr crossfire-0.90.2.orig/server/resurrection.c crossfire-0.90.2/server/resurrection.c
*** crossfire-0.90.2.orig/server/resurrection.c	Mon Mar  7 07:57:42 1994
--- crossfire-0.90.2/server/resurrection.c	Wed Mar  9 14:02:29 1994
***************
*** 27,32 ****
--- 27,34 ----
  /*  the contents of this file were create solely by peterm@soda.berkeley.edu
      all of the above disclaimers apply.  */
  
+ #include <stdlib.h>
+ #include <unistd.h>
  #include <graphics.h>
  #include <global.h>
  #ifndef __CEXTRACT__
diff -cr crossfire-0.90.2.orig/server/rune.c crossfire-0.90.2/server/rune.c
*** crossfire-0.90.2.orig/server/rune.c	Mon Mar  7 07:57:42 1994
--- crossfire-0.90.2/server/rune.c	Wed Mar  9 14:03:30 1994
***************
*** 26,31 ****
--- 26,32 ----
      The author can be reached via e-mail to master@rahul.net
  */
  
+ #include <stdlib.h>
  #include <graphics.h>
  #include <global.h>
  #ifndef __CEXTRACT__
diff -cr crossfire-0.90.2.orig/server/socket.c crossfire-0.90.2/server/socket.c
*** crossfire-0.90.2.orig/server/socket.c	Mon Mar  7 07:57:43 1994
--- crossfire-0.90.2/server/socket.c	Wed Mar  9 14:04:20 1994
***************
*** 30,36 ****
   * I moved them to a separate file, since main() got too clobbered.  -Frank.
   */
  
! 
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
--- 30,37 ----
   * I moved them to a separate file, since main() got too clobbered.  -Frank.
   */
  
! #include <stdio.h>
! #include <unistd.h>
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
***************
*** 66,72 ****
    if(server_mode == SERVER_ENABLED || debug)
      LOG(llevError,"Opening add user socket on %d\n",PORT);
  
! #if defined(hpux) || defined (SOLARIS2_1)
    max_filedescriptors = sysconf(_SC_OPEN_MAX);
  #else
    max_filedescriptors = getdtablesize();
--- 67,73 ----
    if(server_mode == SERVER_ENABLED || debug)
      LOG(llevError,"Opening add user socket on %d\n",PORT);
  
! #if defined(hpux) || defined (SVR4) || defined(_POSIX_SOURCE)
    max_filedescriptors = sysconf(_SC_OPEN_MAX);
  #else
    max_filedescriptors = getdtablesize();
***************
*** 105,111 ****
      perror("error on setsockopt LINGER (NULL version)");
  #endif
  
! #if defined(__osf__) || defined(hpux) || defined(sgi) || defined(NeXT)
    {
      const char tmp =1;
  
--- 106,112 ----
      perror("error on setsockopt LINGER (NULL version)");
  #endif
  
! #if defined(__osf__) || defined(hpux) || defined(sgi) || defined(NeXT) || defined(SVR4)
    {
      const char tmp =1;
  
diff -cr crossfire-0.90.2.orig/server/spells.c crossfire-0.90.2/server/spells.c
*** crossfire-0.90.2.orig/server/spells.c	Mon Mar  7 07:57:43 1994
--- crossfire-0.90.2/server/spells.c	Wed Mar  9 14:04:42 1994
***************
*** 26,31 ****
--- 26,32 ----
      The author can be reached via e-mail to master@rahul.net
  */
  
+ #include <stdlib.h>
  #include <global.h>
  #include <spells.h>
  #include <object.h>
diff -cr crossfire-0.90.2.orig/server/swamp.c crossfire-0.90.2/server/swamp.c
*** crossfire-0.90.2.orig/server/swamp.c	Mon Mar  7 07:57:43 1994
--- crossfire-0.90.2/server/swamp.c	Wed Mar  9 14:04:58 1994
***************
*** 3,8 ****
--- 3,9 ----
   *   "$Id: swamp.c,v 1.5 1994/03/02 05:22:03 master Exp $";
   */
  
+ #include <stdlib.h>
  #include <global.h>
  #ifndef __CEXTRACT__
  #include <sproto.h>
diff -cr crossfire-0.90.2.orig/server/time.c crossfire-0.90.2/server/time.c
*** crossfire-0.90.2.orig/server/time.c	Mon Mar  7 07:57:43 1994
--- crossfire-0.90.2/server/time.c	Wed Mar  9 14:05:25 1994
***************
*** 30,35 ****
--- 30,36 ----
   * collected in this file.
   */
  
+ #include <stdlib.h>
  #include <global.h>
  #include <spells.h>
  #ifndef __CEXTRACT__
diff -cr crossfire-0.90.2.orig/server/xio.c crossfire-0.90.2/server/xio.c
*** crossfire-0.90.2.orig/server/xio.c	Mon Mar  7 07:57:43 1994
--- crossfire-0.90.2/server/xio.c	Wed Mar  9 13:42:17 1994
***************
*** 28,33 ****
--- 28,35 ----
  #ifdef ds
  #include <stddef.h>
  #endif
+ #include <sys/types.h>
+ #include <unistd.h>
  #include <graphics.h>
  #include <bitmaps.h>
  #include <global.h>