Annotation of gforth/engine/libcc.h.in, revision 1.8

1.1       anton       1: /* header file for libcc-generated C code
                      2: 
1.2       anton       3:   Copyright (C) 2006,2007 Free Software Foundation, Inc.
1.1       anton       4: 
                      5:   This file is part of Gforth.
                      6: 
                      7:   Gforth is free software; you can redistribute it and/or
                      8:   modify it under the terms of the GNU General Public License
1.3       anton       9:   as published by the Free Software Foundation, either version 3
1.1       anton      10:   of the License, or (at your option) any later version.
                     11: 
                     12:   This program is distributed in the hope that it will be useful,
                     13:   but WITHOUT ANY WARRANTY; without even the implied warranty of
                     14:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     15:   GNU General Public License for more details.
                     16: 
                     17:   You should have received a copy of the GNU General Public License
1.3       anton      18:   along with this program. If not, see http://www.gnu.org/licenses/.
1.1       anton      19: */
                     20: 
                     21: #include <gforth/@PACKAGE_VERSION@/config.h>
                     22: 
1.5       pazsan     23: #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1.4       pazsan     24: #undef HAS_BACKLINK
                     25: #else
                     26: #define HAS_BACKLINK 1
                     27: #endif
                     28: 
1.1       anton      29: typedef CELL_TYPE Cell;
                     30: typedef double Float;
                     31: 
                     32: #define Clongest long long
                     33: typedef unsigned Clongest UClongest;
                     34: 
1.4       pazsan     35: #ifdef HAS_BACKLINK
1.1       anton      36: extern Cell *gforth_SP;
                     37: extern Float *gforth_FP;
1.4       pazsan     38: extern Cell *gforth_RP;
                     39: extern char *gforth_LP;
                     40: extern char *gforth_UP;
                     41: extern void *gforth_engine(void *, Cell *, Cell *, Float *, char *, char *);
1.8     ! pazsan     42: extern char *cstr(char *from, Cell size, int clear);
        !            43: extern char *tilde_cstr(char *from, Cell size, int clear);
1.4       pazsan     44: #define GFORTH_ARGS void
                     45: #else
                     46: #define gforth_SP *((Cell **)(gforth_pointers[0]))
                     47: #define gforth_FP *((Float **)(gforth_pointers[1]))
                     48: #define gforth_LP *((char **)(gforth_pointers[2]))
                     49: #define gforth_RP *((Cell **)(gforth_pointers[3]))
                     50: #define gforth_UP *((char **)(gforth_pointers[4]))
                     51: #define gforth_engine ((char *(*)(Xt *, Cell *, Cell *, Float *, char *, char *))(((void **)(gforth_pointers[5]))))
1.7       pazsan     52: #define cstr ((char *(*)(char *, Cell, int))(((void **)(gforth_pointers[6]))))
                     53: #define tilde_cstr ((char *(*)(char *, Cell, int))(((void **)(gforth_pointers[7]))))
1.4       pazsan     54: #define GFORTH_ARGS void ** gforth_pointers 
                     55: #endif
1.1       anton      56: 
                     57: #define CELL_BITS      (sizeof(Cell) * 8)
                     58: 
                     59: #define gforth_d2ll(lo,hi) \
                     60:   ((sizeof(Cell) < sizeof(Clongest)) \
                     61:    ? (((UClongest)(lo))|(((UClongest)(hi))<<CELL_BITS)) \
                     62:    : (lo))
                     63: 
                     64: #define gforth_ll2d(ll,lo,hi) \
                     65:   do { \
                     66:     UClongest _ll = (ll); \
                     67:     (lo) = (Cell)_ll; \
                     68:     (hi) = ((sizeof(Cell) < sizeof(Clongest)) \
                     69:             ? (_ll >> CELL_BITS) \
                     70:             : 0); \
                     71:   } while (0);

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>