/* common header file Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc. This file is part of Gforth. Gforth is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ #include "config.h" #include #include #include #if defined(DOUBLY_INDIRECT)||defined(INDIRECT_THREADED)||defined(VM_PROFILING) #define NO_DYNAMIC #endif #if defined(DOUBLY_INDIRECT) # undef DIRECT_THREADED # undef INDIRECT_THREADED # define INDIRECT_THREADED #endif #if defined(GFORTH_DEBUGGING) # undef USE_TOS # undef USE_FTOS # define USE_NO_TOS # define USE_NO_FTOS #endif #include #if defined(NeXT) # include #endif /* NeXT */ /* symbol indexed constants */ #define DOCOL 0 #define DOCON 1 #define DOVAR 2 #define DOUSER 3 #define DODEFER 4 #define DOFIELD 5 #define DODOES 6 #define DOESJUMP 7 /* the size of the DOESJUMP, which resides between DOES> and the does-code */ #define DOES_HANDLER_SIZE (2*sizeof(Cell)) #include "machine.h" /* Forth data types */ /* Cell and UCell must be the same size as a pointer */ #define CELL_BITS (sizeof(Cell) * CHAR_BIT) #define FLAG(b) (-(b)) #define FILEIO(error) (FLAG(error) & -37) #define FILEEXIST(error) (FLAG(error) & -38) #define F_TRUE (FLAG(0==0)) #define F_FALSE (FLAG(0!=0)) #ifdef BUGGY_LONG_LONG typedef struct { Cell hi; UCell lo; } DCell; typedef struct { UCell hi; UCell lo; } UDCell; #if SMALL_OFF_T #define OFF2UD(o) ({UDCell _ud; _ud.hi=0; _ud.lo=(Cell)(o); _ud;}) #define UD2OFF(ud) ((ud).lo) #else /* !SMALL_OFF_T */ #define OFF2UD(o) ({UDCell _ud; off_t _o=(o); _ud.hi=_o>>CELL_BITS; _ud.lo=(Cell)_o; _ud;}) #define UD2OFF(ud) ({UDCell _ud=(ud); (((off_t)_ud.hi)<