$NetBSD: patch-ab,v 1.3 2004/07/04 16:18:14 jschauma Exp $ --- include.h.orig 1995-01-27 08:38:48.000000000 +0100 +++ include.h 2004-07-03 21:54:12.000000000 +0200 @@ -21,6 +21,7 @@ #include #include +#include /* CPUTIME : print CPU time for UNIX 4.2 BSD * if your system has times() function #define CPUTIME 60 @@ -28,7 +29,11 @@ * else #define CPUTIME 0 */ +#if (defined(BSD) && BSD >= 199306) +#define CPUTIME 60 +#else #define SUN4 1 +#endif #define KANJI 1 /* 1: allow EUC Kanji for str functions */ /* Tee print macro */ @@ -135,8 +140,16 @@ #define head_of_list(Term) (((struct clause *)Term)->c_form) #define tail_of_list(Term) ((struct term *)((struct clause *)Term)->c_link) +#if defined(__linux__) +#define is_readable(FP) (!(FP->_flags & _IO_NO_READS)) +#define is_writable(FP) (!(FP->_flags & _IO_NO_WRITES)) +#elif (defined(BSD) && BSD >= 199306) +#define is_readable(FP) (FP->_flags & __SRD) +#define is_writable(FP) (FP->_flags & __SWR) +#else #define is_readable(FP) (FP->_flag & _IOREAD) #define is_writable(FP) (FP->_flag & _IOWRT) +#endif #define is_functor(Term) ((Term)->type.ident > CONST_LIST_TYPE) #define isconst_functor(Term) ((Term)->t_arity <= 0)