X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fsymeval.h;h=141430b881165546e1ab5bfb2494193ec7efb868;hb=2f66a7a3c164a478e7203fc61e3c765de99f1d47;hp=739999b5a6563ef14dba940e7e6cc0cc3d63ce7c;hpb=59eec5f21669e81977b5b1fe9bf717cab49cf7fb;p=chise%2Fxemacs-chise.git.1 diff --git a/src/symeval.h b/src/symeval.h index 739999b..141430b 100644 --- a/src/symeval.h +++ b/src/symeval.h @@ -31,7 +31,7 @@ enum symbol_value_type { /* The following tags use the 'symbol_value_forward' structure and are strictly for variables DEFVARed on the C level. */ - SYMVAL_FIXNUM_FORWARD, /* Forward C "int" */ + SYMVAL_FIXNUM_FORWARD, /* Forward C "Fixnum", really "EMACS_INT" */ SYMVAL_CONST_FIXNUM_FORWARD, /* Same, but can't be set */ SYMVAL_BOOLEAN_FORWARD, /* Forward C boolean ("int") */ SYMVAL_CONST_BOOLEAN_FORWARD, /* Same, but can't be set */ @@ -70,6 +70,9 @@ enum symbol_value_type #endif }; +/* Underlying C type used to implement DEFVAR_INT */ +typedef EMACS_INT Fixnum; + struct symbol_value_magic { struct lcrecord_header lcheader; @@ -345,13 +348,21 @@ void defvar_magic (const char *symbol_name, const struct symbol_value_forward *m #define DEFVAR_SYMVAL_FWD_INT(lname, c_location, forward_type, magicfun) do{ \ DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ - dumpopaque (c_location, sizeof(int)); \ + dump_add_opaque_int (c_location); \ } while (0) -#define DEFVAR_SYMVAL_FWD_OBJECT(lname, c_location, forward_type, magicfun) do{ \ +#define DEFVAR_SYMVAL_FWD_FIXNUM(lname, c_location, forward_type, magicfun) do{ \ DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ - staticpro (c_location); \ - if (EQ (*c_location, Qnull_pointer)) *c_location = Qnil; \ + dump_add_opaque_fixnum (c_location); \ +} while (0) + +#define DEFVAR_SYMVAL_FWD_OBJECT(lname, c_location, forward_type, magicfun) do{ \ + DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun); \ + { \ + Lisp_Object *DSF_location = c_location; /* Type check */ \ + staticpro (DSF_location); \ + if (EQ (*DSF_location, Qnull_pointer)) *DSF_location = Qnil; \ + } \ } while (0) #define DEFVAR_LISP(lname, c_location) \ @@ -361,9 +372,9 @@ void defvar_magic (const char *symbol_name, const struct symbol_value_forward *m #define DEFVAR_SPECIFIER(lname, c_location) \ DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_CONST_SPECIFIER_FORWARD, 0) #define DEFVAR_INT(lname, c_location) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_FIXNUM_FORWARD, 0) + DEFVAR_SYMVAL_FWD_FIXNUM (lname, c_location, SYMVAL_FIXNUM_FORWARD, 0) #define DEFVAR_CONST_INT(lname, c_location) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_CONST_FIXNUM_FORWARD, 0) + DEFVAR_SYMVAL_FWD_FIXNUM (lname, c_location, SYMVAL_CONST_FIXNUM_FORWARD, 0) #define DEFVAR_BOOL(lname, c_location) \ DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, 0) #define DEFVAR_CONST_BOOL(lname, c_location) \ @@ -371,8 +382,10 @@ void defvar_magic (const char *symbol_name, const struct symbol_value_forward *m #define DEFVAR_LISP_MAGIC(lname, c_location, magicfun) \ DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, magicfun) #define DEFVAR_INT_MAGIC(lname, c_location, magicfun) \ - DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun) + DEFVAR_SYMVAL_FWD_FIXNUM (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun) #define DEFVAR_BOOL_MAGIC(lname, c_location, magicfun) \ DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, magicfun) +void flush_all_buffer_local_cache (void); + #endif /* INCLUDED_symeval_h_ */