Annotation of gforth/engine/libcc.h.in, revision 1.4
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.4 ! pazsan 23: #if defined(_WIN32) || defined(__WIN32__)
! 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 *);
! 42: #define GFORTH_ARGS void
! 43: #else
! 44: #define gforth_SP *((Cell **)(gforth_pointers[0]))
! 45: #define gforth_FP *((Float **)(gforth_pointers[1]))
! 46: #define gforth_LP *((char **)(gforth_pointers[2]))
! 47: #define gforth_RP *((Cell **)(gforth_pointers[3]))
! 48: #define gforth_UP *((char **)(gforth_pointers[4]))
! 49: #define gforth_engine ((char *(*)(Xt *, Cell *, Cell *, Float *, char *, char *))(((void **)(gforth_pointers[5]))))
! 50: #define GFORTH_ARGS void ** gforth_pointers
! 51: #endif
1.1 anton 52:
53: #define CELL_BITS (sizeof(Cell) * 8)
54:
55: #define gforth_d2ll(lo,hi) \
56: ((sizeof(Cell) < sizeof(Clongest)) \
57: ? (((UClongest)(lo))|(((UClongest)(hi))<<CELL_BITS)) \
58: : (lo))
59:
60: #define gforth_ll2d(ll,lo,hi) \
61: do { \
62: UClongest _ll = (ll); \
63: (lo) = (Cell)_ll; \
64: (hi) = ((sizeof(Cell) < sizeof(Clongest)) \
65: ? (_ll >> CELL_BITS) \
66: : 0); \
67: } while (0);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>