X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/fd09688b0bbd5ee8011e78a1f4e794603e27232f..d1f55f1668a70cc196509d11c7c92d22b1aa5ee7:/src/lisp.h diff --git a/src/lisp.h b/src/lisp.h index 5c84bb8e06..bd19da55b2 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1,5 +1,5 @@ /* Fundamental definitions for GNU Emacs Lisp interpreter. - Copyright (C) 1985-1987, 1993-1995, 1997-2011 + Copyright (C) 1985-1987, 1993-1995, 1997-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -132,9 +132,9 @@ extern int suppress_checking EXTERNALLY_VISIBLE; #define eassert(X) ((void) (0 && (X))) /* Check that X compiles. */ #else /* ENABLE_CHECKING */ #if defined (__GNUC__) && __GNUC__ >= 2 && defined (__STDC__) -#define eassert(cond) CHECK(cond,"assertion failed: " #cond) +#define eassert(cond) CHECK (cond, "assertion failed: " #cond) #else -#define eassert(cond) CHECK(cond,"assertion failed") +#define eassert(cond) CHECK (cond, "assertion failed") #endif #endif /* ENABLE_CHECKING */ @@ -162,12 +162,28 @@ extern int suppress_checking EXTERNALLY_VISIBLE; /* First, try and define DECL_ALIGN(type,var) which declares a static variable VAR of type TYPE with the added requirement that it be - TYPEBITS-aligned. */ + TYPEBITS-aligned. */ + +#ifndef GCTYPEBITS +#define GCTYPEBITS 3 +#endif + +#ifndef VALBITS +#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS) +#endif + #ifndef NO_DECL_ALIGN # ifndef DECL_ALIGN # if HAVE_ATTRIBUTE_ALIGNED # define DECL_ALIGN(type, var) \ type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var +# elif defined(_MSC_VER) +# define ALIGN_GCTYPEBITS 8 +# if (1 << GCTYPEBITS) != ALIGN_GCTYPEBITS +# error ALIGN_GCTYPEBITS is wrong! +# endif +# define DECL_ALIGN(type, var) \ + type __declspec(align(ALIGN_GCTYPEBITS)) var # else /* What directives do other compilers use? */ # endif @@ -179,7 +195,14 @@ extern int suppress_checking EXTERNALLY_VISIBLE; || defined DARWIN_OS || defined __sun) /* We also need to be able to specify mult-of-8 alignment on static vars. */ # if defined DECL_ALIGN -# define USE_LSB_TAG +/* On hosts where VALBITS is greater than the pointer width in bits, + USE_LSB_TAG is: + a. unnecessary, because the top bits of an EMACS_INT are unused, and + b. slower, because it typically requires extra masking. + So, define USE_LSB_TAG only on hosts where it might be useful. */ +# if UINTPTR_MAX >> VALBITS != 0 +# define USE_LSB_TAG +# endif # endif #endif @@ -225,6 +248,15 @@ extern int suppress_checking EXTERNALLY_VISIBLE; # endif #endif +/* Stolen from GDB. The only known compiler that doesn't support + enums in bitfields is MSVC. */ +#ifdef _MSC_VER +#define ENUM_BF(TYPE) unsigned int +#else +#define ENUM_BF(TYPE) enum TYPE +#endif + + enum Lisp_Type { /* Integer. XINT (obj) is the integer value. */ @@ -288,15 +320,6 @@ enum Lisp_Fwd_Type Lisp_Fwd_Kboard_Obj, /* Fwd to a Lisp_Object field of kboards. */ }; -#ifndef GCTYPEBITS -#define GCTYPEBITS 3 -#endif - -/* These values are overridden by the m- file on some machines. */ -#ifndef VALBITS -#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS) -#endif - #ifdef USE_LISP_UNION_TYPE #ifndef WORDS_BIGENDIAN @@ -312,15 +335,15 @@ union Lisp_Object struct { - /* Use explict signed, the signedness of a bit-field of type + /* Use explicit signed, the signedness of a bit-field of type int is implementation defined. */ signed EMACS_INT val : VALBITS; - enum Lisp_Type type : GCTYPEBITS; + ENUM_BF (Lisp_Type) type : GCTYPEBITS; } s; struct { EMACS_UINT val : VALBITS; - enum Lisp_Type type : GCTYPEBITS; + ENUM_BF (Lisp_Type) type : GCTYPEBITS; } u; } Lisp_Object; @@ -336,14 +359,14 @@ union Lisp_Object struct { - enum Lisp_Type type : GCTYPEBITS; - /* Use explict signed, the signedness of a bit-field of type + ENUM_BF (Lisp_Type) type : GCTYPEBITS; + /* Use explicit signed, the signedness of a bit-field of type int is implementation defined. */ signed EMACS_INT val : VALBITS; } s; struct { - enum Lisp_Type type : GCTYPEBITS; + ENUM_BF (Lisp_Type) type : GCTYPEBITS; EMACS_UINT val : VALBITS; } u; } @@ -584,20 +607,20 @@ extern Lisp_Object make_number (EMACS_INT); /* Extract a value or address from a Lisp_Object. */ -#define XCONS(a) (eassert (CONSP(a)),(struct Lisp_Cons *) XPNTR(a)) -#define XVECTOR(a) (eassert (VECTORLIKEP(a)),(struct Lisp_Vector *) XPNTR(a)) -#define XSTRING(a) (eassert (STRINGP(a)),(struct Lisp_String *) XPNTR(a)) -#define XSYMBOL(a) (eassert (SYMBOLP(a)),(struct Lisp_Symbol *) XPNTR(a)) -#define XFLOAT(a) (eassert (FLOATP(a)),(struct Lisp_Float *) XPNTR(a)) +#define XCONS(a) (eassert (CONSP (a)), (struct Lisp_Cons *) XPNTR (a)) +#define XVECTOR(a) (eassert (VECTORLIKEP (a)), (struct Lisp_Vector *) XPNTR (a)) +#define XSTRING(a) (eassert (STRINGP (a)), (struct Lisp_String *) XPNTR (a)) +#define XSYMBOL(a) (eassert (SYMBOLP (a)), (struct Lisp_Symbol *) XPNTR (a)) +#define XFLOAT(a) (eassert (FLOATP (a)), (struct Lisp_Float *) XPNTR (a)) /* Misc types. */ -#define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) -#define XMISCANY(a) (eassert (MISCP (a)), &(XMISC(a)->u_any)) +#define XMISC(a) ((union Lisp_Misc *) XPNTR (a)) +#define XMISCANY(a) (eassert (MISCP (a)), &(XMISC (a)->u_any)) #define XMISCTYPE(a) (XMISCANY (a)->type) -#define XMARKER(a) (eassert (MARKERP (a)), &(XMISC(a)->u_marker)) -#define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC(a)->u_overlay)) -#define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC(a)->u_save_value)) +#define XMARKER(a) (eassert (MARKERP (a)), &(XMISC (a)->u_marker)) +#define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC (a)->u_overlay)) +#define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC (a)->u_save_value)) /* Forwarding object types. */ @@ -612,14 +635,14 @@ extern Lisp_Object make_number (EMACS_INT); /* Pseudovector types. */ -#define XPROCESS(a) (eassert (PROCESSP(a)),(struct Lisp_Process *) XPNTR(a)) -#define XWINDOW(a) (eassert (WINDOWP(a)),(struct window *) XPNTR(a)) -#define XTERMINAL(a) (eassert (TERMINALP(a)),(struct terminal *) XPNTR(a)) -#define XSUBR(a) (eassert (SUBRP(a)),(struct Lisp_Subr *) XPNTR(a)) -#define XBUFFER(a) (eassert (BUFFERP(a)),(struct buffer *) XPNTR(a)) -#define XCHAR_TABLE(a) (eassert (CHAR_TABLE_P (a)), (struct Lisp_Char_Table *) XPNTR(a)) -#define XSUB_CHAR_TABLE(a) (eassert (SUB_CHAR_TABLE_P (a)), (struct Lisp_Sub_Char_Table *) XPNTR(a)) -#define XBOOL_VECTOR(a) (eassert (BOOL_VECTOR_P (a)), (struct Lisp_Bool_Vector *) XPNTR(a)) +#define XPROCESS(a) (eassert (PROCESSP (a)), (struct Lisp_Process *) XPNTR (a)) +#define XWINDOW(a) (eassert (WINDOWP (a)), (struct window *) XPNTR (a)) +#define XTERMINAL(a) (eassert (TERMINALP (a)), (struct terminal *) XPNTR (a)) +#define XSUBR(a) (eassert (SUBRP (a)), (struct Lisp_Subr *) XPNTR (a)) +#define XBUFFER(a) (eassert (BUFFERP (a)), (struct buffer *) XPNTR (a)) +#define XCHAR_TABLE(a) (eassert (CHAR_TABLE_P (a)), (struct Lisp_Char_Table *) XPNTR (a)) +#define XSUB_CHAR_TABLE(a) (eassert (SUB_CHAR_TABLE_P (a)), (struct Lisp_Sub_Char_Table *) XPNTR (a)) +#define XBOOL_VECTOR(a) (eassert (BOOL_VECTOR_P (a)), (struct Lisp_Bool_Vector *) XPNTR (a)) /* Construct a Lisp_Object from a value or address. */ @@ -637,7 +660,7 @@ extern Lisp_Object make_number (EMACS_INT); /* Pseudovector types. */ -#define XSETPVECTYPE(v, code) XSETTYPED_PVECTYPE(v, header.size, code) +#define XSETPVECTYPE(v, code) XSETTYPED_PVECTYPE (v, header.size, code) #define XSETTYPED_PVECTYPE(v, size_member, code) \ ((v)->size_member |= PSEUDOVECTOR_FLAG | (code)) #define XSETPVECTYPESIZE(v, code, sizeval) \ @@ -749,8 +772,8 @@ struct Lisp_Cons #endif /* Use these from normal code. */ -#define XCAR(c) LISP_MAKE_RVALUE(XCAR_AS_LVALUE(c)) -#define XCDR(c) LISP_MAKE_RVALUE(XCDR_AS_LVALUE(c)) +#define XCAR(c) LISP_MAKE_RVALUE (XCAR_AS_LVALUE (c)) +#define XCDR(c) LISP_MAKE_RVALUE (XCDR_AS_LVALUE (c)) /* Use these to set the fields of a cons cell. @@ -758,8 +781,8 @@ struct Lisp_Cons should not be read after 'c' is first modified. Also, neither argument should be evaluated more than once; side effects are especially common in the second argument. */ -#define XSETCAR(c,n) (XCAR_AS_LVALUE(c) = (n)) -#define XSETCDR(c,n) (XCDR_AS_LVALUE(c) = (n)) +#define XSETCAR(c,n) (XCAR_AS_LVALUE (c) = (n)) +#define XSETCDR(c,n) (XCDR_AS_LVALUE (c) = (n)) /* Take the car or cdr of something whose type is not known. */ #define CAR(c) \ @@ -872,14 +895,14 @@ struct Lisp_Vector of the shortest vector that would hold that struct. */ #define VECSIZE(type) ((sizeof (type) \ - offsetof (struct Lisp_Vector, contents[0]) \ - + sizeof(Lisp_Object) - 1) /* round up */ \ + + sizeof (Lisp_Object) - 1) /* round up */ \ / sizeof (Lisp_Object)) /* Like VECSIZE, but used when the pseudo-vector has non-Lisp_Object fields at the end and we need to compute the number of Lisp_Object fields (the ones that the GC needs to trace). */ #define PSEUDOVECSIZE(type, nonlispfield) \ - ((offsetof(type, nonlispfield) - offsetof(struct Lisp_Vector, contents[0])) \ + ((offsetof (type, nonlispfield) - offsetof (struct Lisp_Vector, contents[0])) \ / sizeof (Lisp_Object)) /* A char-table is a kind of vectorlike, with contents are like a @@ -931,7 +954,7 @@ struct Lisp_Vector /* Compute A OP B, using the unsigned comparison operator OP. A and B should be integer expressions. This is not the same as - mathemeatical comparison; for example, UNSIGNED_CMP (0, <, -1) + mathematical comparison; for example, UNSIGNED_CMP (0, <, -1) returns 1. For efficiency, prefer plain unsigned comparison if A and B's sizes both fit (after integer promotion). */ #define UNSIGNED_CMP(a, op, b) \ @@ -1084,11 +1107,9 @@ enum symbol_redirect SYMBOL_PLAINVAL = 4, SYMBOL_VARALIAS = 1, SYMBOL_LOCALIZED = 2, - SYMBOL_FORWARDED = 3 + SYMBOL_FORWARDED = 3 }; -/* In a symbol, the markbit of the plist is used as the gc mark bit */ - struct Lisp_Symbol { unsigned gcmarkbit : 1; @@ -1097,9 +1118,8 @@ struct Lisp_Symbol 0 : it's a plain var, the value is in the `value' field. 1 : it's a varalias, the value is really in the `alias' symbol. 2 : it's a localized var, the value is in the `blv' object. - 3 : it's a forwarding variable, the value is in `forward'. - */ - enum symbol_redirect redirect : 3; + 3 : it's a forwarding variable, the value is in `forward'. */ + ENUM_BF (symbol_redirect) redirect : 3; /* Non-zero means symbol is constant, i.e. changing its value should signal an error. If the value is 3, then the var @@ -1115,15 +1135,12 @@ struct Lisp_Symbol unsigned declared_special : 1; /* The symbol's name, as a Lisp string. - The name "xname" is used to intentionally break code referring to the old field "name" of type pointer to struct Lisp_String. */ Lisp_Object xname; - /* Value of the symbol or Qunbound if unbound. If this symbol is a - defvaralias, `alias' contains the symbol for which it is an - alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get - and set a symbol's value, to take defvaralias into account. */ + /* Value of the symbol or Qunbound if unbound. Which alternative of the + union is used depends on the `redirect' field above. */ union { Lisp_Object value; struct Lisp_Symbol *alias; @@ -1315,16 +1332,16 @@ struct Lisp_Hash_Table struct Lisp_Misc_Any /* Supertype of all Misc types. */ { - enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */ + ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_??? */ unsigned gcmarkbit : 1; int spacer : 15; - /* Make it as long as "Lisp_Free without padding". */ + /* Make it as long as "Lisp_Free without padding". */ void *fill; }; struct Lisp_Marker { - enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Marker */ + ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Marker */ unsigned gcmarkbit : 1; int spacer : 13; /* This flag is temporarily used in the functions @@ -1474,7 +1491,7 @@ struct Lisp_Overlay I.e. 9words plus 2 bits, 3words of which are for external linked lists. */ { - enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Overlay */ + ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */ unsigned gcmarkbit : 1; int spacer : 15; struct Lisp_Overlay *next; @@ -1493,7 +1510,7 @@ struct Lisp_Kboard_Objfwd This type of object is used in the arg to record_unwind_protect. */ struct Lisp_Save_Value { - enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Save_Value */ + ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */ unsigned gcmarkbit : 1; int spacer : 14; /* If DOGC is set, POINTER is the address of a memory @@ -1507,7 +1524,7 @@ struct Lisp_Save_Value /* A miscellaneous object, when it's on the free list. */ struct Lisp_Free { - enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Free */ + ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Free */ unsigned gcmarkbit : 1; int spacer : 15; union Lisp_Misc *chain; @@ -1599,16 +1616,6 @@ typedef unsigned char UCHAR; itself. */ #define CHARACTERBITS 22 -/* The maximum byte size consumed by push_key_description. - All callers should assure that at least this size of memory is - allocated at the place pointed by the second argument. - - There are 6 modifiers, each consumes 2 chars. - The octal form of a character code consumes - (1 + CHARACTERBITS / 3 + 1) chars (including backslash at the head). - We need one more byte for string terminator `\0'. */ -#define KEY_DESCRIPTION_SIZE ((2 * 6) + 1 + (CHARACTERBITS / 3) + 1 + 1) - /* The glyph datatype, used to represent characters on the display. It consists of a char code and a face id. */ @@ -1881,9 +1888,6 @@ typedef struct { CHECK_NATNUM (tmp); \ XSETCDR ((x), tmp); \ } while (0) - -/* Cast pointers to this type to compare them. */ -#define PNTR_COMPARISON_TYPE uintptr_t /* Define a built-in function for calling from Lisp. `lname' should be the name to give the function in Lisp, @@ -1912,13 +1916,23 @@ typedef struct { /* This version of DEFUN declares a function prototype with the right arguments, so we can catch errors with maxargs at compile-time. */ -#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ - Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ - static DECL_ALIGN (struct Lisp_Subr, sname) = \ - { PVEC_SUBR, \ - { .a ## maxargs = fnname }, \ - minargs, maxargs, lname, intspec, 0}; \ - Lisp_Object fnname +#ifdef _MSC_VER +#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ + Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ + static DECL_ALIGN (struct Lisp_Subr, sname) = \ + { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ + { (Lisp_Object (__cdecl *)(void))fnname }, \ + minargs, maxargs, lname, intspec, 0}; \ + Lisp_Object fnname +#else /* not _MSC_VER */ +#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ + Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ + static DECL_ALIGN (struct Lisp_Subr, sname) = \ + { PVEC_SUBR, \ + { .a ## maxargs = fnname }, \ + minargs, maxargs, lname, intspec, 0}; \ + Lisp_Object fnname +#endif /* Note that the weird token-substitution semantics of ANSI C makes this work for MANY and UNEVALLED. */ @@ -2120,7 +2134,10 @@ extern char *stack_bottom; Exception: if you set immediate_quit to nonzero, then the handler that responds to the C-g does the quit itself. This is a good thing to do around a loop that has no side effects - and (in particular) cannot call arbitrary Lisp code. */ + and (in particular) cannot call arbitrary Lisp code. + + If quit-flag is set to `kill-emacs' the SIGINT handler has received + a request to exit Emacs when it is safe to do. */ #ifdef SYNC_INPUT extern void process_pending_signals (void); @@ -2132,16 +2149,11 @@ extern int pending_signals; #define ELSE_PENDING_SIGNALS #endif /* not SYNC_INPUT */ +extern void process_quit_flag (void); #define QUIT \ do { \ if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ - { \ - Lisp_Object flag = Vquit_flag; \ - Vquit_flag = Qnil; \ - if (EQ (Vthrow_on_input, flag)) \ - Fthrow (Vthrow_on_input, Qt); \ - Fsignal (Qquit, Qnil); \ - } \ + process_quit_flag (); \ ELSE_PENDING_SIGNALS \ } while (0) @@ -2215,143 +2227,127 @@ struct gcpro || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) -#define GCPRO1(var) \ - GCPRO1_VAR (var, gcpro) -#define GCPRO2(var1, var2) \ - GCPRO2_VAR (var1, var2, gcpro) -#define GCPRO3(var1, var2, var3) \ - GCPRO3_VAR (var1, var2, var3, gcpro) -#define GCPRO4(var1, var2, var3, var4) \ - GCPRO4_VAR (var1, var2, var3, var4, gcpro) -#define GCPRO5(var1, var2, var3, var4, var5) \ - GCPRO5_VAR (var1, var2, var3, var4, var5, gcpro) -#define GCPRO6(var1, var2, var3, var4, var5, var6) \ - GCPRO6_VAR (var1, var2, var3, var4, var5, var6, gcpro) -#define UNGCPRO UNGCPRO_VAR (gcpro) - #if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS /* Do something silly with gcproN vars just so gcc shuts up. */ /* You get warnings from MIPSPro... */ -#define GCPRO1_VAR(var, gcpro) ((void) gcpro##1) -#define GCPRO2_VAR(var1, var2, gcpro) \ - ((void) gcpro##2, (void) gcpro##1) -#define GCPRO3_VAR(var1, var2, var3, gcpro) \ - ((void) gcpro##3, (void) gcpro##2, (void) gcpro##1) -#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - ((void) gcpro##4, (void) gcpro##3, (void) gcpro##2, (void) gcpro##1) -#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - ((void) gcpro##5, (void) gcpro##4, (void) gcpro##3, (void) gcpro##2, \ - (void) gcpro##1) -#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - ((void) gcpro##6, (void) gcpro##5, (void) gcpro##4, (void) gcpro##3, \ - (void) gcpro##2, (void) gcpro##1) -#define UNGCPRO_VAR(gcpro) ((void) 0) +#define GCPRO1(varname) ((void) gcpro1) +#define GCPRO2(varname1, varname2) ((void) gcpro2, (void) gcpro1) +#define GCPRO3(varname1, varname2, varname3) \ + ((void) gcpro3, (void) gcpro2, (void) gcpro1) +#define GCPRO4(varname1, varname2, varname3, varname4) \ + ((void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1) +#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ + ((void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1) +#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ + ((void) gcpro6, (void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, \ + (void) gcpro1) +#define UNGCPRO ((void) 0) #else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ #ifndef DEBUG_GCPRO -#define GCPRO1_VAR(var, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \ - gcprolist = &gcpro##1; } - -#define GCPRO2_VAR(var1, var2, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcprolist = &gcpro##2; } - -#define GCPRO3_VAR(var1, var2, var3, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcprolist = &gcpro##3; } - -#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcprolist = &gcpro##4; } - -#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ - gcprolist = &gcpro##5; } - -#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ - gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \ - gcprolist = &gcpro##6; } - -#define UNGCPRO_VAR(gcpro) (gcprolist = gcpro##1.next) +#define GCPRO1(varname) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ + gcprolist = &gcpro1; } + +#define GCPRO2(varname1, varname2) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcprolist = &gcpro2; } + +#define GCPRO3(varname1, varname2, varname3) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcprolist = &gcpro3; } + +#define GCPRO4(varname1, varname2, varname3, varname4) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcprolist = &gcpro4; } + +#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcprolist = &gcpro5; } + +#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ + gcprolist = &gcpro6; } + +#define UNGCPRO (gcprolist = gcpro1.next) #else extern int gcpro_level; -#define GCPRO1_VAR(var, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level++; \ - gcprolist = &gcpro##1; } - -#define GCPRO2_VAR(var1, var2, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##2.level = gcpro_level++; \ - gcprolist = &gcpro##2; } - -#define GCPRO3_VAR(var1, var2, var3, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##3.level = gcpro_level++; \ - gcprolist = &gcpro##3; } - -#define GCPRO4_VAR(var1, var2, var3, var4, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcpro##4.level = gcpro_level++; \ - gcprolist = &gcpro##4; } - -#define GCPRO5_VAR(var1, var2, var3, var4, var5, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ - gcpro##5.level = gcpro_level++; \ - gcprolist = &gcpro##5; } - -#define GCPRO6_VAR(var1, var2, var3, var4, var5, var6, gcpro) \ - {gcpro##1.next = gcprolist; gcpro##1.var = &var1; gcpro##1.nvars = 1; \ - gcpro##1.level = gcpro_level; \ - gcpro##2.next = &gcpro##1; gcpro##2.var = &var2; gcpro##2.nvars = 1; \ - gcpro##3.next = &gcpro##2; gcpro##3.var = &var3; gcpro##3.nvars = 1; \ - gcpro##4.next = &gcpro##3; gcpro##4.var = &var4; gcpro##4.nvars = 1; \ - gcpro##5.next = &gcpro##4; gcpro##5.var = &var5; gcpro##5.nvars = 1; \ - gcpro##6.next = &gcpro##5; gcpro##6.var = &var6; gcpro##6.nvars = 1; \ - gcpro##6.level = gcpro_level++; \ - gcprolist = &gcpro##6; } - -#define UNGCPRO_VAR(gcpro) \ - ((--gcpro_level != gcpro##1.level) \ - ? (abort (), 0) \ - : ((gcprolist = gcpro##1.next), 0)) +#define GCPRO1(varname) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level++; \ + gcprolist = &gcpro1; } + +#define GCPRO2(varname1, varname2) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro2.level = gcpro_level++; \ + gcprolist = &gcpro2; } + +#define GCPRO3(varname1, varname2, varname3) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro3.level = gcpro_level++; \ + gcprolist = &gcpro3; } + +#define GCPRO4(varname1, varname2, varname3, varname4) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro4.level = gcpro_level++; \ + gcprolist = &gcpro4; } + +#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcpro5.level = gcpro_level++; \ + gcprolist = &gcpro5; } + +#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ + {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \ + gcpro1.level = gcpro_level; \ + gcpro2.next = &gcpro1; gcpro2.var = &varname2; gcpro2.nvars = 1; \ + gcpro3.next = &gcpro2; gcpro3.var = &varname3; gcpro3.nvars = 1; \ + gcpro4.next = &gcpro3; gcpro4.var = &varname4; gcpro4.nvars = 1; \ + gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \ + gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ + gcpro6.level = gcpro_level++; \ + gcprolist = &gcpro6; } + +#define UNGCPRO \ + ((--gcpro_level != gcpro1.level) \ + ? (abort (), 0) \ + : ((gcprolist = gcpro1.next), 0)) #endif /* DEBUG_GCPRO */ #endif /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ @@ -2941,6 +2937,7 @@ extern Lisp_Object Qinhibit_quit, Qclosure; extern Lisp_Object Qand_rest; extern Lisp_Object Vautoload_queue; extern Lisp_Object Vsignaling_function; +extern Lisp_Object inhibit_lisp_code; extern int handling_signal; #if BYTE_MARK_STACK extern struct catchtag *catchlist; @@ -3149,10 +3146,6 @@ extern void syms_of_fileio (void); extern Lisp_Object make_temp_name (Lisp_Object, int); extern Lisp_Object Qdelete_file; -/* Defined in abbrev.c */ - -extern void syms_of_abbrev (void); - /* Defined in search.c */ extern void shrink_regexp_cache (void); EXFUN (Fstring_match, 3); @@ -3258,8 +3251,6 @@ extern void force_auto_save_soon (void); extern void init_keyboard (void); extern void syms_of_keyboard (void); extern void keys_of_keyboard (void); -extern char *push_key_description (EMACS_INT, char *, int); - /* Defined in indent.c */ EXFUN (Fvertical_motion, 2); @@ -3296,7 +3287,7 @@ extern void syms_of_frame (void); /* Defined in emacs.c */ extern char **initial_argv; extern int initial_argc; -#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS) +#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) extern int display_arg; #endif extern Lisp_Object decode_env_path (const char *, const char *); @@ -3305,6 +3296,7 @@ extern Lisp_Object Qfile_name_handler_alist; #ifdef FLOAT_CATCH_SIGILL extern void fatal_error_signal (int); #endif +extern Lisp_Object Qkill_emacs; EXFUN (Fkill_emacs, 1) NO_RETURN; #if HAVE_SETLOCALE void fixup_locale (void); @@ -3615,7 +3607,7 @@ extern void init_system_name (void); #define SWITCH_ENUM_CAST(x) (x) -/* Use this to suppress gcc's warnings. */ +/* Use this to suppress gcc's warnings. */ #ifdef lint /* Use CODE only if lint checking is in effect. */ @@ -3642,7 +3634,7 @@ extern void init_system_name (void); /* We used to use `abs', but that clashes with system headers on some platforms, and using a name reserved by Standard C is a bad idea anyway. */ -#if !defined(eabs) +#if !defined (eabs) #define eabs(x) ((x) < 0 ? -(x) : (x)) #endif