machine.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* Define machine-dependencies for bison,
  2. Copyright (C) 1984, 1989 Free Software Foundation, Inc.
  3. This file is part of Bison, the GNU Compiler Compiler.
  4. Bison is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. Bison is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with Bison; see the file COPYING. If not, write to
  14. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  15. #ifdef eta10
  16. #define MAXSHORT 2147483647
  17. #define MINSHORT -2147483648
  18. #else
  19. #define MAXSHORT 32767
  20. #define MINSHORT -32768
  21. #endif
  22. #if defined (MSDOS) && !defined (__GO32__)
  23. #define BITS_PER_WORD 16
  24. #define MAXTABLE 16383
  25. #else
  26. #define BITS_PER_WORD 32
  27. #define MAXTABLE 32767
  28. #endif
  29. #define WORDSIZE(n) (((n) + BITS_PER_WORD - 1) / BITS_PER_WORD)
  30. #define SETBIT(x, i) ((x)[(i)/BITS_PER_WORD] |= (1<<((i) % BITS_PER_WORD)))
  31. #define RESETBIT(x, i) ((x)[(i)/BITS_PER_WORD] &= ~(1<<((i) % BITS_PER_WORD)))
  32. #define BITISSET(x, i) (((x)[(i)/BITS_PER_WORD] & (1<<((i) % BITS_PER_WORD))) != 0)