#ifndef MACHINE_H #define MACHINE_H /* * How to extract an unsigned char from a char *. * If your compiler has the type 'unsigned char', then the cast-version * is best. If you do not know, use the simple version, and the game will * immediately terminate with a message if bad. #define EXTRACT_UCHAR(p) (*(p) < 0 ? *(p) + 0x100 : *(p)) */ #define EXTRACT_UCHAR(p) (*(unsigned char *)(p)) /* An integer that has the same size as a pointer */ typedef long p_int; typedef unsigned long p_uint; #define SIZEOF_P_INT (4) /* must be evaluable by the preprocessor */ /* An integer that has half the size of a pointer */ typedef short ph_int; typedef unsigned short ph_uint; /* An integer that has at least the size of a pointer */ typedef long mp_int; typedef unsigned long mp_uint; /* An integer with 32 bits */ typedef long int32; typedef unsigned long uint32; /* * Does the system have a getrusage call? * On solaris, don't define this unless you link with bsd libraries. */ #define RUSAGE /* If so, is it restricted to user and system time? */ #undef RUSAGE_RESTRICTED /* * Undef this if your system doesn't support Berkley type symlinks. */ #undef SYMLINKS /* * Define what ioctl to use against tty's. */ #if 0 #define USE_TIOCGETP /* BSD */ #else #define USE_TCGETA /* SYSV */ #endif /* * Some LPmuds on sun4 and sparcstations have had problems with the * call of inet_ntoa() in comm1.c. * If the game crash in query_ip_number() when using inet_ntoa(), * then undefine the following symbol. * The query_ip_number() is called when doing the 'people' command * for example. */ #define INET_NTOA_OK /* * Define SYSV if you are running system V with a lower release level than * Sys V.4. Unless it's defined in your stdio.h. */ #undef SYSV /* * Define FCHMOD_MISSING only if your system doesn't have fchmod(). */ #define FCHMOD_MISSING /* * USE_FCNTL_FNDELAY * * Probably due to a gcc-bug the socket_ioctl doesn't work correctly if * the driver is compiled using gcc-2.3.2, at least on Sparcstations. * #define this if your GD crashes immediatly after the * Setting up ipc.-message with an operation-not-allowed-on-socket-error */ #undef USE_FCNTL_FNDELAY /************************************************************************/ /* END OF CONFIG -- DO NOT ALTER ANYTHING BELOW THIS LINE */ /************************************************************************/ #if defined(sparc) #define MALLOC_ALIGN 8 #define MALLOC_ALIGN_8 #endif #ifndef MALLOC_ALIGN #define MALLOC_ALIGN 4 #endif /* The following is needed for smalloc without SBRK_OK to use memory * efficiently. smalloc will malloc blocks that are a large power of * two, minus EXTERN_MALLOC_OVERHEAD. If you have no idea what number to * choose, compile & run util/overhead.c */ #define EXTERN_MALLOC_OVERHEAD 8 #if defined(atarist) #ifndef NO_IP_DEMON #define NO_IP_DEMON #endif #endif #if defined(AMIGA) # define NO_IP_DEMON # ifndef AMIGA_TCP # undef CATCH_UDP_PORT # undef UDP_SEND # endif #endif #if defined(M_UNIX) || defined(linux) #ifndef POSIX #define POSIX #endif #endif #if defined( NeXT ) || ( defined(sun) && defined(__svr4__) ) #ifndef INET_NTOA_OK #define INET_NTOA_OK #endif #endif #ifdef RUSAGE #if !defined(solaris) #define RUSAGE_TIME(t) ( (t).tv_sec * 1000 + (t).tv_usec / 1000 ) #else #define RUSAGE_TIME(t) ( (t).tv_sec * 1000 + (t).tv_nsec / 1000000 ) #endif #else /* !RUSAGE */ #undef RUSAGE_RESTRICTED #define RUSAGE_RESTRICTED #ifdef POSIX #define RUSAGE_SELF 0 struct rusage { long ru_utime, ru_stime; }; #define RUSAGE_TIME(t) ( (t) * 1000 / sysconf(_SC_CLK_TCK) ) #endif /* POSIX */ #endif /* RUSAGE */ #endif /* MACHINE_H */