X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/a0f6b076110ea79f25e13701d7f0ee4b38630d4d..720d742f8e74acf1ade85a7d39c02fa5b9528b5a:/src/system.h diff --git a/src/system.h b/src/system.h index d878feb2..56a0ba0e 100644 --- a/src/system.h +++ b/src/system.h @@ -22,6 +22,8 @@ # include #endif +#include + #ifdef MSDOS # include #endif @@ -32,18 +34,14 @@ # define getpid _getpid #endif -#if defined(HAVE_STDLIB_H) || defined(MSDOS) +#if HAVE_STDLIB_H # include #endif -#if defined(HAVE_UNISTD_H) +#if HAVE_UNISTD_H # include #endif -#if (defined(VMS) || defined(MSDOS)) && !defined(HAVE_STRING_H) -# define HAVE_STRING_H 1 -#endif - #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) # include /* An ANSI string.h and pre-ANSI memory.h might conflict. */ @@ -67,6 +65,11 @@ extern int errno; #endif +#if PROTOTYPES +# define PARAMS(p) p +#else +# define PARAMS(p) () +#endif /*-----------------. | GCC extensions. | @@ -119,3 +122,29 @@ extern int errno; #endif #endif /* BISON_SYSTEM_H */ + + +/*---------------------------------. +| Machine-dependencies for Bison. | +`---------------------------------*/ + +#ifdef eta10 +# define MAXSHORT 2147483647 +# define MINSHORT -2147483648 +#else +# define MAXSHORT 32767 +# define MINSHORT -32768 +#endif + +#if defined (MSDOS) && !defined (__GO32__) +# define BITS_PER_WORD 16 +# define MAXTABLE 16383 +#else +# define BITS_PER_WORD 32 +# define MAXTABLE 32767 +#endif + +#define WORDSIZE(n) (((n) + BITS_PER_WORD - 1) / BITS_PER_WORD) +#define SETBIT(x, i) ((x)[(i)/BITS_PER_WORD] |= (1<<((i) % BITS_PER_WORD))) +#define RESETBIT(x, i) ((x)[(i)/BITS_PER_WORD] &= ~(1<<((i) % BITS_PER_WORD))) +#define BITISSET(x, i) (((x)[(i)/BITS_PER_WORD] & (1<<((i) % BITS_PER_WORD))) != 0)