aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorKaroly Lorentey2004-01-22 15:37:19 +0000
committerKaroly Lorentey2004-01-22 15:37:19 +0000
commit2a36494c42a1963846ea8c2dde48a7450d433c2a (patch)
tree59be675dcc23b117a04a5b16cc82d73bcb6abbc9 /src/lisp.h
parente9cda8277618ce4e2644e852539474b7b67f09e3 (diff)
parente555f8d5a4cfa2a1496ed61795ab6dc143600698 (diff)
downloademacs-2a36494c42a1963846ea8c2dde48a7450d433c2a.tar.gz
emacs-2a36494c42a1963846ea8c2dde48a7450d433c2a.zip
Merged in changes from CVS HEAD
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-33 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-34 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-35 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-36 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-37 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-38 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-39 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-40 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-41 Make fringe-drawing stuff compile without a window-system * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-42 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-43 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-44 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-45 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-46 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-47 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-48 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-49 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-50 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-59
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h81
1 files changed, 74 insertions, 7 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 8c6374e6004..570d5ff9757 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1,5 +1,5 @@
1/* Fundamental definitions for GNU Emacs Lisp interpreter. 1/* Fundamental definitions for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985,86,87,93,94,95,97,98,1999,2000, 2001, 2002, 2003 2 Copyright (C) 1985,86,87,93,94,95,97,98,1999,2000,01,02,03,2004
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -67,10 +67,6 @@ extern void die P_((const char *, const char *, int));
67 ? (void) 0 \ 67 ? (void) 0 \
68 : die ((msg), __FILE__, __LINE__)), \ 68 : die ((msg), __FILE__, __LINE__)), \
69 0) 69 0)
70
71/* Let's get some compile-time checking too. */
72#undef NO_UNION_TYPE
73
74#else 70#else
75 71
76/* Produce same side effects and result, but don't complain. */ 72/* Produce same side effects and result, but don't complain. */
@@ -293,12 +289,55 @@ enum pvec_type
293/* For convenience, we also store the number of elements in these bits. */ 289/* For convenience, we also store the number of elements in these bits. */
294#define PSEUDOVECTOR_SIZE_MASK 0x1ff 290#define PSEUDOVECTOR_SIZE_MASK 0x1ff
295 291
292/***** Select the tagging scheme. *****/
293
294/* First, try and define DECL_ALIGN(type,var) which declares a static
295 variable VAR of type TYPE with the added requirement that it be
296 TYPEBITS-aligned. */
297#if defined USE_LSB_TAG && !defined DECL_ALIGN
298/* What compiler directive should we use for non-gcc compilers? -stef */
299# if defined (__GNUC__)
300# define DECL_ALIGN(type, var) \
301 type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
302# else
303# error "USE_LSB_TAG used without defining DECL_ALIGN"
304# endif
305#endif
306
307#ifndef USE_LSB_TAG
308/* Just remove the alignment annotation if we don't use it. */
309#undef DECL_ALIGN
310#define DECL_ALIGN(type, var) type var
311#endif
312
313
296/* These macros extract various sorts of values from a Lisp_Object. 314/* These macros extract various sorts of values from a Lisp_Object.
297 For example, if tem is a Lisp_Object whose type is Lisp_Cons, 315 For example, if tem is a Lisp_Object whose type is Lisp_Cons,
298 XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons. */ 316 XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons. */
299 317
300#ifdef NO_UNION_TYPE 318#ifdef NO_UNION_TYPE
301 319
320#ifdef USE_LSB_TAG
321
322#define TYPEMASK ((((EMACS_INT) 1) << GCTYPEBITS) - 1)
323#define XTYPE(a) ((enum Lisp_Type) (((EMACS_UINT) (a)) & TYPEMASK))
324#define XINT(a) (((EMACS_INT) (a)) >> GCTYPEBITS)
325#define XUINT(a) (((EMACS_UINT) (a)) >> GCTYPEBITS)
326#define XSET(var, type, ptr) \
327 (eassert (XTYPE (ptr) == 0), /* Check alignment. */ \
328 (var) = ((EMACS_INT) (type)) | ((EMACS_INT) (ptr)))
329#define make_number(N) (((EMACS_INT) (N)) << GCTYPEBITS)
330
331/* XFASTINT and XSETFASTINT are for use when the integer is known to be
332 positive, in which case the implementation can sometimes be faster
333 depending on the tagging scheme. With USE_LSB_TAG, there's no benefit. */
334#define XFASTINT(a) XINT (a)
335#define XSETFASTINT(a, b) ((a) = make_number (b))
336
337#define XPNTR(a) ((EMACS_INT) ((a) & ~TYPEMASK))
338
339#else /* not USE_LSB_TAG */
340
302#define VALMASK ((((EMACS_INT) 1) << VALBITS) - 1) 341#define VALMASK ((((EMACS_INT) 1) << VALBITS) - 1)
303 342
304/* One need to override this if there must be high bits set in data space 343/* One need to override this if there must be high bits set in data space
@@ -337,6 +376,8 @@ enum pvec_type
337#define make_number(N) \ 376#define make_number(N) \
338 ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS) 377 ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS)
339 378
379#endif /* not USE_LSB_TAG */
380
340#define EQ(x, y) ((x) == (y)) 381#define EQ(x, y) ((x) == (y))
341 382
342#else /* not NO_UNION_TYPE */ 383#else /* not NO_UNION_TYPE */
@@ -1150,6 +1191,13 @@ struct Lisp_Free
1150 unsigned gcmarkbit : 1; 1191 unsigned gcmarkbit : 1;
1151 int spacer : 15; 1192 int spacer : 15;
1152 union Lisp_Misc *chain; 1193 union Lisp_Misc *chain;
1194#ifdef USE_LSB_TAG
1195 /* Try to make sure that sizeof(Lisp_Misc) preserves TYPEBITS-alignment.
1196 This assumes that Lisp_Marker is the largest of the alternatives and
1197 that Lisp_Intfwd has the same size as "Lisp_Free w/o padding". */
1198 char padding[((((sizeof (struct Lisp_Marker) - 1) >> GCTYPEBITS) + 1)
1199 << GCTYPEBITS) - sizeof (struct Lisp_Intfwd)];
1200#endif
1153 }; 1201 };
1154 1202
1155/* To get the type field of a union Lisp_Misc, use XMISCTYPE. 1203/* To get the type field of a union Lisp_Misc, use XMISCTYPE.
@@ -1517,7 +1565,7 @@ typedef unsigned char UCHAR;
1517 1565
1518#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \ 1566#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \
1519 Lisp_Object fnname (); \ 1567 Lisp_Object fnname (); \
1520 struct Lisp_Subr sname = \ 1568 DECL_ALIGN (struct Lisp_Subr, sname) = \
1521 { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ 1569 { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \
1522 fnname, minargs, maxargs, lname, prompt, 0}; \ 1570 fnname, minargs, maxargs, lname, prompt, 0}; \
1523 Lisp_Object fnname 1571 Lisp_Object fnname
@@ -1528,7 +1576,7 @@ typedef unsigned char UCHAR;
1528 arguments, so we can catch errors with maxargs at compile-time. */ 1576 arguments, so we can catch errors with maxargs at compile-time. */
1529#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \ 1577#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \
1530 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ 1578 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
1531 struct Lisp_Subr sname = \ 1579 DECL_ALIGN (struct Lisp_Subr, sname) = \
1532 { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ 1580 { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \
1533 fnname, minargs, maxargs, lname, prompt, 0}; \ 1581 fnname, minargs, maxargs, lname, prompt, 0}; \
1534 Lisp_Object fnname 1582 Lisp_Object fnname
@@ -1675,6 +1723,9 @@ extern char *stack_bottom;
1675 This is a good thing to do around a loop that has no side effects 1723 This is a good thing to do around a loop that has no side effects
1676 and (in particular) cannot call arbitrary Lisp code. */ 1724 and (in particular) cannot call arbitrary Lisp code. */
1677 1725
1726#ifdef SYNC_INPUT
1727extern void handle_async_input P_ ((void));
1728extern int interrupt_input_pending;
1678#define QUIT \ 1729#define QUIT \
1679 do { \ 1730 do { \
1680 if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ 1731 if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \
@@ -1682,8 +1733,24 @@ extern char *stack_bottom;
1682 Vquit_flag = Qnil; \ 1733 Vquit_flag = Qnil; \
1683 Fsignal (Qquit, Qnil); \ 1734 Fsignal (Qquit, Qnil); \
1684 } \ 1735 } \
1736 else if (interrupt_input_pending) \
1737 handle_async_input (); \
1685 } while (0) 1738 } while (0)
1686 1739
1740#else /* not SYNC_INPUT */
1741
1742#define QUIT \
1743 do { \
1744 if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \
1745 { \
1746 Vquit_flag = Qnil; \
1747 Fsignal (Qquit, Qnil); \
1748 } \
1749 } while (0)
1750
1751#endif /* not SYNC_INPUT */
1752
1753
1687/* Nonzero if ought to quit now. */ 1754/* Nonzero if ought to quit now. */
1688 1755
1689#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) 1756#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit))