From de9d0155374a42a5d2cb0b2366b9d02c0c1189ec Mon Sep 17 00:00:00 2001 From: Etienne Brateau <etienne.brateau@ensiie.fr> Date: Wed, 4 Jul 2018 23:23:01 +0200 Subject: [PATCH] Remove useless define --- log/src/Makefile | 37 ++------------ log/src/ana/Makefile | 37 ++------------ log/src/log.c | 33 ------------ log/src/logdef.h | 8 --- log/src/loged.c | 8 --- psys/include/p2c/newcrt.h | 5 -- psys/include/p2c/p2c.h | 25 +-------- psys/src/Makefile | 34 ++---------- psys/src/lunix_pas.c | 5 -- psys/src/misc.c | 80 +---------------------------- psys/src/mylib.c | 32 ------------ psys/src/newasmlib.c | 29 ----------- psys/src/newci.c | 11 ---- psys/src/newcrt.c | 105 -------------------------------------- psys/src/p2clib.c | 17 +----- psys/src/sysdevs.c | 15 ------ 16 files changed, 17 insertions(+), 464 deletions(-) diff --git a/log/src/Makefile b/log/src/Makefile index 43b56b7..f7dc5ff 100644 --- a/log/src/Makefile +++ b/log/src/Makefile @@ -149,39 +149,12 @@ CC = $(CHIPMUNKCC) ## ## Add these flags to the CHIPMUNKFLAGS below: ## -## Linux/86 -m32 -DBSD -Dlinux -DF_OK=0 -## Apple OS X -m32 -DBSD -Dlinux -Dfreebsd -## FreeBSD -m32 -DBSD -Dfreebsd -Dlinux -DF_OK=0 -## -## The platforms below are legacy, these flags may no longer be sufficient. -## -## Solaris 2.X -Daux -## DEC Alpha (Linux or OSF) -DBSD -Dlinux -DF_OK=0 -D__GCC__ -## HP series 800 (gcc) -## HP series 800 (cc) -w -Aa -D_HPUX_SOURCE -DF_OK=0 -## FreeBSD -DBSD -Dfreebsd -Dlinux -DF_OK=0 -m486 -## SGI Irix 5.2/5,3 -ansi -Wf -XNd10000 -## (if -Wf -XNd10000 isn't supported by -## your compiler, delete them) -## Solaris 1.X (SunOS) -## IBM RS/6000 (xlc) -DBSD=0 -Drs6000 -## Apple AU/X -Daux -## Apple MachTen -DBSD -DF_OK=0 -## AmigaOS (gcc) -ansi -DBSD -DF_OK=0 -## -## -## AmigaOS: if you are using X shared library with ADE, see notes below -## in log and loged rules, also -## to increase speed, try to add -O3 and, based on your CPU, one of these -## -## -m68020 : for 68020 -## -m68020 -m68881 : for 68020+6888x -## -m68030 : for 68030 -## -m68030 -m68881 : for 68030+6888x -## -m68040 : for 68040 and 68060 -## +## Linux/86 -m32 +## Apple OS X -m32 +## FreeBSD -m32 +## -CHIPMUNKFLAGS = -m32 -DBSD -Dlinux -DF_OK=0 +CHIPMUNKFLAGS = -m32 CFLAGS = $(CHIPMUNKFLAGS) -I$(LOCINC) -I$(XINCLUDEDIR) -DLOGLIB=\"$(LOGLIBDIR)\" -DF_OK=0 diff --git a/log/src/ana/Makefile b/log/src/ana/Makefile index bfaaeea..69cf0f6 100644 --- a/log/src/ana/Makefile +++ b/log/src/ana/Makefile @@ -74,39 +74,12 @@ CC = $(CHIPMUNKCC) ## ## Add these flags to the CHIPMUNKFLAGS below: ## -## Linux/86 -m32 -DBSD -Dlinux -DF_OK=0 -## Apple OS X -m32 -DBSD -Dlinux -Dfreebsd -## FreeBSD -m32 -DBSD -Dfreebsd -Dlinux -DF_OK=0 -## -## The platforms below are legacy, these flags may no longer be sufficient. -## -## Solaris 2.X -Daux -## DEC Alpha (Linux or OSF) -DBSD -Dlinux -DF_OK=0 -D__GCC__ -## HP series 800 (gcc) -## HP series 800 (cc) -w -Aa -D_HPUX_SOURCE -DF_OK=0 -## FreeBSD -DBSD -Dfreebsd -Dlinux -DF_OK=0 -m486 -## SGI Irix 5.2/5,3 -ansi -Wf -XNd10000 -## (if -Wf -XNd10000 isn't supported by -## your compiler, delete them) -## Solaris 1.X (SunOS) -## IBM RS/6000 (xlc) -DBSD=0 -Drs6000 -## Apple AU/X -Daux -## Apple MachTen -DBSD -DF_OK=0 -## AmigaOS (gcc) -ansi -DBSD -DF_OK=0 -## -## -## AmigaOS: if you are using X shared library with ADE, see notes below -## in log and loged rules, also -## to increase speed, try to add -O3 and, based on your CPU, one of these -## -## -m68020 : for 68020 -## -m68020 -m68881 : for 68020+6888x -## -m68030 : for 68030 -## -m68030 -m68881 : for 68030+6888x -## -m68040 : for 68040 and 68060 -## +## Linux/86 -m32 +## Apple OS X -m32 +## FreeBSD -m32 +## -CHIPMUNKFLAGS = -m32 -DBSD -Dlinux -DF_OK=0 +CHIPMUNKFLAGS = -m32 OPTIONS = -Wall -Wextra diff --git a/log/src/log.c b/log/src/log.c index b8533c8..d579831 100644 --- a/log/src/log.c +++ b/log/src/log.c @@ -45,22 +45,6 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <p2c/p2c.h> -#if aux -/* ***A/UX error in strtod **mdg** */ -double t_strtod(str, ptr) -char *str, **ptr; -{ - double d; - char s; - d = strtod(str, ptr);(*ptr)--; - s = *ptr[0]; - if(isdigit(s) != 0) (*ptr)++; - return d; -} -#define strtod(a,b) t_strtod(a,b) -#endif - - #include "logdef.h" #include <p2c/sysglobals.h> #include <p2c/sysdevs.h> @@ -210,11 +194,7 @@ extern int findprocedure (char *name, void (**start)()); typedef struct descrec { -#ifdef __alpha__ - int ptr; -#else long ptr; -#endif uchar numvects, numpins, numpnums, lblsize, simtype, procsize; /* log_kflags */ short flag; schar xx1, yy1, xx2, yy2; @@ -229,11 +209,7 @@ typedef union filerec { schar sb[256]; char c[256]; short sh[128]; -#ifdef __alpha__ - int i[64]; -#else long i[64]; -#endif log_pac8 ix[32]; ovectorrec vec[64]; log_pinrec pin[64]; @@ -5409,15 +5385,9 @@ static void pass() /* p2c: log.text, line 5010: * Note: Suspicious mixture of sizes in NA_NEW [173] */ -#ifdef __alpha__ - ht = (log_htrec *)Malloc(sizeof(log_htrec) - - log_million * sizeof(void *) + - hncount * sizeof(void *) *2); -#else ht = (log_htrec *)Malloc(sizeof(log_htrec) - log_million * sizeof(void *) + hncount * sizeof(void *)); -#endif ht->next = NULL; ht->time = gg.time; @@ -21833,10 +21803,7 @@ int main(int argc, char * argv[]) libf1[temp1 - 1] = NULL; TRY(try40); initialize(); -#define HCL_KLUDGE -#ifdef HCL_KLUDGE printf("\210\f Starting\201\210 LOG\f\200"); -#endif /* HCL_KLUDGE */ do { gg.initdone = true; gg.fastspeed = gg.fastmin; diff --git a/log/src/logdef.h b/log/src/logdef.h index ca53338..e1ca296 100644 --- a/log/src/logdef.h +++ b/log/src/logdef.h @@ -156,11 +156,7 @@ typedef struct log_kattrrec { } U73; char *c; char *sp; -#ifdef mips - unsigned b; -#else unsigned b : 1 ; -#endif struct { na_strlistrec *v; short nv, dv; @@ -182,11 +178,7 @@ typedef struct log_gattrrec { } U73; char *c; char *sp; -#ifdef mips - unsigned b; -#else unsigned b : 1 ; -#endif short nv; } UU; } log_gattrrec; /* Gate attribute entry */ diff --git a/log/src/loged.c b/log/src/loged.c index d108899..a2679d1 100644 --- a/log/src/loged.c +++ b/log/src/loged.c @@ -186,11 +186,7 @@ typedef union filerec { schar sb[256]; uchar c[256]; short sh[128]; -#ifdef __alpha__ - int i[64]; -#else long i[64]; -#endif gatename ix[32]; ovectorrec vec[64]; pinrec pin[64]; @@ -212,11 +208,7 @@ typedef struct oldrec { _REC_pin pin[32]; short numvects; ovectorrec vector[64]; -#ifdef __alpha__ - int next; -#else long next; -#endif } oldrec; diff --git a/psys/include/p2c/newcrt.h b/psys/include/p2c/newcrt.h index 9d5bbc2..a89717e 100644 --- a/psys/include/p2c/newcrt.h +++ b/psys/include/p2c/newcrt.h @@ -234,13 +234,8 @@ void nc_putchar (uchar c); void nc_puts (char * s); void nc_fputs (char * s, FILE *outfile); -#ifdef VARARGS -void nc_printf(va_alist); -void nc_fprintf (va_alist); -#else void nc_printf (char * fmt, ...); void nc_fprintf (FILE * outfile, char * fmt, ...); -#endif #define printf nc_printf #define fprintf nc_fprintf diff --git a/psys/include/p2c/p2c.h b/psys/include/p2c/p2c.h index 16457e0..873ebf9 100644 --- a/psys/include/p2c/p2c.h +++ b/psys/include/p2c/p2c.h @@ -3,35 +3,12 @@ #include <stdio.h> -/* If the following heuristic fails, compile -DBSD=0 for non-BSD systems, - or -DBSD=1 for BSD systems. */ - -#ifdef FILE /* a #define in BSD, a typedef in SYSV (hp-ux, at least) */ -# ifndef BSD /* (a convenient, but horrible kludge!) */ -# define BSD 1 -# endif -#endif - -#ifdef BSD -# if !BSD -# undef BSD -# endif -#endif - - # include <stddef.h> # include <stdlib.h> -# define HAS_STDLIB #include <string.h> -#ifdef BSD -#ifdef __MACHTEN__ -extern char *strdup(const char *); -#endif -#endif - -#ifdef linux +#ifdef __linux__ #include <unistd.h> #endif diff --git a/psys/src/Makefile b/psys/src/Makefile index f4e6803..7c31745 100644 --- a/psys/src/Makefile +++ b/psys/src/Makefile @@ -1,4 +1,3 @@ - # "PSYS", p-system emulation libraries for the Caltech tools, # # Copyright (C) 1983, 1990, 1993 California Institute of Technology. @@ -163,36 +162,11 @@ FONTS = ## ## Add these flags to the CHIPMUNKFLAGS below: ## -## Linux/86 -m32 -DBSD -Dlinux -DF_OK=0 -## Apple OS X -m32 -DBSD -Dlinux -Dfreebsd -## FreeBSD -m32 -DBSD -Dfreebsd -Dlinux -DF_OK=0 -## -## The platforms below are legacy, these flags may no longer be sufficient. -## -## Solaris 2.X -Daux -Dsolaris -## Solaris 1.X (SunOS) -DBSD -## HP series 800 (gcc) -## HP series 800 (cc) -w -Aa -D_HPUX_SOURCE -DF_OK=0 -## Apple AU/X -Daux -## Apple MachTen -DBSD -DF_OK=0 -## DEC Alpha (Linux or OSF) -DBSD -Dlinux -DF_OK=0 -D__GCC__ -## SGI Irix 5.2/5,3 -ansi -## AmigaOS (gcc) -ansi -DBSD -DF_OK=0 -## -## In addition, very old systems whose compilers do not support <stdarg.h> -## may need to add -DVARARGS to CHIPMUNKFLAGS. -## -## AmigaOS: to increase speed, try to add -O3 and, based on your CPU, one of -## these -## -## -m68020 : for 68020 -## -m68020 -m68881 : for 68020+6888x -## -m68030 : for 68030 -## -m68030 -m68881 : for 68030+6888x -## -m68040 : for 68040 and 68060 -## +## Linux/86 -m32 +## Apple OS X -m32 +## FreeBSD -m32 -CHIPMUNKFLAGS = -m32 -DBSD -Dlinux -DF_OK=0 +CHIPMUNKFLAGS = -m32 OPTIONS = -Wall -Wextra diff --git a/psys/src/lunix_pas.c b/psys/src/lunix_pas.c index bcae92c..b431435 100644 --- a/psys/src/lunix_pas.c +++ b/psys/src/lunix_pas.c @@ -1,11 +1,6 @@ #define LUNIX_PAS_G - #include <time.h> -#ifdef aux -# include <sys/types.h> /* A/UX needs this. */ -# include <sys/time.h> /* A/UX needs this, too! */ -#endif #include <p2c/p2c.h> #include <p2c/lunix_pas.h> diff --git a/psys/src/misc.c b/psys/src/misc.c index 23eb72f..b7aa238 100644 --- a/psys/src/misc.c +++ b/psys/src/misc.c @@ -26,45 +26,7 @@ void misc_printerror(long esc, long ior) } -#ifdef __bsdi__ -char *cuserid(char *s) -{ - char *sp; - static char sbuf[L_cuserid + 1]; - - if ((sp = getenv("USER")) == NULL) { - if (s != NULL) - s[0] = '\0'; - return NULL; - } - return strncpy(s != NULL ? s : sbuf, sp, L_cuserid); -} - -long lrand48() -{ - return random(); -} - -void srand48(long seedv) -{ - srandom( (int)seedv); -} - -int cfree(char *ptr) -{ - free(ptr); - return 0; -} - -int _cfree(char *ptr) -{ - printf("Call to _cfree.\n"); - free(ptr); - return 0; -} -#endif - -#ifdef freebsd +#ifdef __FreeBSD__|| __bsdi__ int cfree(char *ptr) { @@ -107,46 +69,6 @@ char *_cuserid(char *s) #endif -#ifdef __MACHTEN__ - -char *cuserid(char *s) -{ - char *sp; - static char sbuf[L_cuserid + 1]; - - if ((sp = getenv("USER")) == NULL) { - if (s != NULL) - s[0] = '\0'; - return NULL; - } - return strncpy(s != NULL ? s : sbuf, sp, L_cuserid); -} - -long lrand48() -{ - return random(); -} - -void srand48(long seedv) -{ - srandom( (int)seedv); -} - -int cfree(char *ptr) -{ - free(ptr); - return 0; -} - -int _cfree(char *ptr) -{ - printf("Call to _cfree.\n"); - free(ptr); - return 0; -} - -#endif - #ifndef LACK_GETPWNAM diff --git a/psys/src/mylib.c b/psys/src/mylib.c index 087715c..ace71f9 100644 --- a/psys/src/mylib.c +++ b/psys/src/mylib.c @@ -19,16 +19,7 @@ #include <string.h> #endif /* HIRES */ #include <math.h> - -#if defined(aux) -# include <sys/types.h> -# include <sys/time.h> -# include <time.h> -#elif defined(BSD) -# include <sys/time.h> -#else # include <time.h> -#endif #include <p2c/p2c.h> #include <p2c/mylib.h> @@ -2001,17 +1992,6 @@ int c; Xfprintf(stderr, "XSetFunction(m_display, oldgrid->gc2, GXand)\n"); XSetFunction(m_display, oldgrid->gc2, GXand); -#ifdef old_linux /* linux fix by harold levy */ - XSetPlaneMask (m_display, newgrid->gc1, AllPlanes); - XSetPlaneMask (m_display, newgrid->gc2, AllPlanes); - XSetPlaneMask (m_display, oldgrid->gc1, AllPlanes); - XSetPlaneMask (m_display, oldgrid->gc2, AllPlanes); - XSetPlaneMask (m_display, CursorGC, AllPlanes); - XSetPlaneMask (m_display, CursorGC2, AllPlanes); - XSetPlaneMask (m_display, CursorGC3, AllPlanes); - for (i = 0; i < ColorsInSet; i ++) - XSetPlaneMask(m_display, gc[i], AllPlanes); -#endif break; case m_xor: if ((BlackAndWhite) && @@ -2026,18 +2006,6 @@ int c; Xfprintf(stderr, "XSetFunction(m_display, oldgrid->gc1, GXxor)\n"); XSetFunction(m_display, oldgrid->gc1, GXxor); - -#ifdef old_linux /* linux fix by Harold Levy */ - XSetPlaneMask (m_display, newgrid->gc1, notAllPlanes); - XSetPlaneMask (m_display, newgrid->gc2, notAllPlanes); - XSetPlaneMask (m_display, oldgrid->gc1, notAllPlanes); - XSetPlaneMask (m_display, oldgrid->gc2, notAllPlanes); - XSetPlaneMask (m_display, CursorGC, notAllPlanes); - XSetPlaneMask (m_display, CursorGC2, notAllPlanes); - XSetPlaneMask (m_display, CursorGC3, notAllPlanes); - for (i = 0; i < ColorsInSet; i ++) - XSetPlaneMask(m_display, gc[i], notAllPlanes); -#endif } break; case m_over: diff --git a/psys/src/newasmlib.c b/psys/src/newasmlib.c index 10a3e7d..4231115 100644 --- a/psys/src/newasmlib.c +++ b/psys/src/newasmlib.c @@ -7,22 +7,11 @@ #define KEEP_P2C_DECLS -#if defined(BSD) # include <time.h> -# include <sys/time.h> -#else -# include <time.h> -#endif #include <p2c/p2c.h> #include <p2c/newasm.h> -#ifdef aux -#if (!defined(solaris) && !defined(__MACHTEN__)) -# define LACKS_STRDUP /* A/UX needs this. */ -#endif -#endif - /* The following would benefit from assembly language if possible */ #define ROL_L(v,n) (((v) << n) | ((unsigned long)(v) >> (32-(n)))) @@ -1385,11 +1374,7 @@ register char *s; while ((lp = *base) && strcmp(lp->s, s) < 0) base = &lp->next; if (!lp || strcmp(lp->s, s)) { -#ifdef __alpha__ - lp = (na_strlist_t *)malloc(sizeof(na_strlist_t)); -#else lp = (na_strlist_t *)malloc(sizeof(na_strlist_t) - 255 + len); -#endif if (!lp) outmem(); lp->next = *base; *base = lp; @@ -1412,11 +1397,7 @@ register char *s; while ((lp = *base)) base = &lp->next; -#ifdef __alpha__ - lp = (na_strlist_t *)malloc(sizeof(na_strlist_t)); -#else lp = (na_strlist_t *)malloc(sizeof(na_strlist_t) - 255 + len); -#endif if (!lp) outmem(); lp->next = NULL; *base = lp; @@ -1436,11 +1417,7 @@ register char *s; register na_strlist_t *lp; register int len = strlen(s); -#ifdef __alpha__ - lp = (na_strlist_t *)malloc(sizeof(na_strlist_t)); -#else lp = (na_strlist_t *)malloc(sizeof(na_strlist_t) - 255 + len); -#endif if (!lp) outmem(); lp->next = *base; *base = lp; @@ -1451,8 +1428,6 @@ register char *s; return lp; } - - na_strlist_t *strlist_find(base, s) register na_strlist_t *base; register char *s; @@ -1557,11 +1532,7 @@ register na_strlist_t **dest, *src; register na_strlist_t *lp; while (src) { -#ifdef __alpha__ - lp = (na_strlist_t *)malloc(sizeof(na_strlist_t)); -#else lp = (na_strlist_t *)malloc(sizeof(na_strlist_t) - 255 + src->len); -#endif lp->len = src->len; lp->kind = src->kind; lp->value = src->value; diff --git a/psys/src/newci.c b/psys/src/newci.c index 4aa6fcc..e0a229e 100644 --- a/psys/src/newci.c +++ b/psys/src/newci.c @@ -3,18 +3,7 @@ #include <stdio.h> #include <ctype.h> -#if defined(aux) -# include <sys/types.h> -# include <sys/time.h> # include <time.h> -#elif defined(BSD) -# include <sys/types.h> -# include <sys/wait.h> -# include <time.h> -# include <sys/time.h> -#else -# include <time.h> -#endif #include <p2c/p2c.h> #include <p2c/newci.h> diff --git a/psys/src/newcrt.c b/psys/src/newcrt.c index 688cf22..66adf5d 100644 --- a/psys/src/newcrt.c +++ b/psys/src/newcrt.c @@ -2,23 +2,15 @@ #define HIRES #include <stdio.h> -#ifdef VARARGS -#include <varargs.h> -#else #include <stdarg.h> -#endif #include <signal.h> #include <p2c/p2c.h> #include <p2c/newcrt.h> -#ifndef MYLIB_H #include <p2c/mylib.h> -#endif -#ifndef SYSDEVS_H #include <p2c/sysdevs.h> -#endif #include <X11/X.h> #include <X11/Xutil.h> @@ -843,39 +835,6 @@ unsigned char *str, *buf; *cp2 = '\0'; } -#ifdef VARARGS - -void nc_printf(va_alist) -va_dcl -{ - va_list args; - char *fmt, fmt2[1024]; - char printbuffer[2000], printbuffer2[2000]; - char *p1, *p2; - -/* fprintf(stderr, "nc_printf() called, cursor at (%d,%d)\n", XPOS, YPOS); */ - va_start(args); - fmt = va_arg(args, char *); - - if (! nc_text_in_window) { - fix_string((unsigned char *) fmt, (unsigned char *) fmt2); - vprintf(fmt2, args); - va_end(args); - return; - } - vsprintf(printbuffer, fmt, args); - va_end(args); - for (p1 = printbuffer, p2 = printbuffer2; *p1 != '\0'; p1++, p2++) - if ((*p2 = *p1) == '\n') - *(++p2) = '\015'; - *p2 = '\0'; - - nc_writeStr(XPOS, YPOS, printbuffer2); -/* fprintf(stderr, "nc_printf() exits, cursor at (%d,%d)\n", XPOS, YPOS); */ -} - -#else - void nc_printf(char * fmt, ...) { @@ -905,29 +864,6 @@ void nc_printf(char * fmt, ...) } -#endif /* OS2 */ - - -#ifdef VARARGS - -void zfprintf(va_alist) -va_dcl - -{ - va_list args; - FILE *outfile; - char *fmt; - char fmt2[1024]; - char printbuffer[2000], printbuffer2[2000]; - char *p1, *p2; - - va_start(args); - outfile = va_arg(args, FILE *); - fmt = va_arg(args, char *); - vfprintf(outfile, fmt, args); -} - -#else void zfprintf(FILE * outfile, char * fmt, ...) @@ -938,46 +874,8 @@ void zfprintf(FILE * outfile, char * fmt, ...) char *p1, *p2; va_start(args, fmt); -/* This leaves OS2 a no-op */ -} - -#endif - -#ifdef VARARGS - -void nc_fprintf(va_alist) -va_dcl -{ - va_list args; - FILE *outfile; - char *fmt, fmt2[1024]; - char printbuffer[2000], printbuffer2[2000]; - char *p1, *p2; - - va_start(args); - outfile = va_arg(args, FILE *); - fmt = va_arg(args, char *); -/* - vfprintf(outfile, fmt, args); -*/ - if (nc_text_in_window && ((outfile == stdout)/* || (outfile == stderr) */)) { - vsprintf(printbuffer, fmt, args); - va_end(args); - for (p1 = printbuffer, p2 = printbuffer2; *p1 != '\0'; p1++, p2++) - if ((*p2 = *p1) == '\n') - *(++p2) = '\015'; - *p2 = '\0'; - - nc_writeStr(XPOS, YPOS, printbuffer2); - } else { - fix_string((unsigned char *) fmt, (unsigned char *) fmt2); - vfprintf(outfile, fmt2, args); - va_end(args); - } } -#else - void nc_fprintf(FILE * outfile, char * fmt, ...) { @@ -1004,10 +902,7 @@ void nc_fprintf(FILE * outfile, char * fmt, ...) } } -#endif - void nc_puts(char * s) - { char str2[1024]; diff --git a/psys/src/p2clib.c b/psys/src/p2clib.c index be49105..8c2da2a 100644 --- a/psys/src/p2clib.c +++ b/psys/src/p2clib.c @@ -7,13 +7,7 @@ */ -#ifndef NO_TIME # include <time.h> -# ifdef aux -# include <sys/types.h> /* A/UX needs this. */ -# include <sys/time.h> /* A/UX needs this, too! */ -# endif -#endif #include <p2c/p2c.h> @@ -416,11 +410,6 @@ long memavail() return 10000000; /* worry about this later! */ } -long maxavail() -{ - return memavail(); -} - /* Sets are stored as an array of longs. S[0] is the size of the set; S[N] is the N'th 32-bit chunk of the set. S[0] equals the maximum I such that S[I] is nonzero. S[0] is zero for an empty set. Within @@ -840,10 +829,6 @@ int code; return _Escape(-10); } -#ifndef NULL -#define NULL 0 -#endif - char *GetChipmunkPath(ev, deft) char *ev, *deft; { @@ -883,7 +868,7 @@ long usec; /* delay in microseconds */ delay.tv_sec = usec / 1000000L; delay.tv_usec = usec % 1000000L; -#if defined( linux ) || defined( __osf__ ) +#if defined(__linux__) || defined( __osf__ ) return select( 0, (fd_set *)0, (fd_set *)0, (fd_set *)0, (struct timeval *)&delay ); #else return select( 0, (int *)0, (int *)0, (int *)0, (struct timeval *)&delay ); diff --git a/psys/src/sysdevs.c b/psys/src/sysdevs.c index ad69109..8b278af 100644 --- a/psys/src/sysdevs.c +++ b/psys/src/sysdevs.c @@ -1,27 +1,12 @@ #define SYSDEVS_G - -#if defined(aux) -# include <sys/types.h> /* A/UX needs this. */ -# include <time.h> -# include <sys/time.h> /* A/UX needs this, too! */ -#elif defined(BSD) -# include <time.h> -# include <sys/time.h> -# include <sys/types.h> -#else # include <time.h> -#endif #include <p2c/p2c.h> -#ifndef SYSGLOBALS_H #include <p2c/sysglobals.h> -#endif -#ifndef SYSDEVS_H #include <p2c/sysdevs.h> -#endif long systclock() { -- GitLab