XEmacs 21.4.4 "Artificial Intelligence".
[chise/xemacs-chise.git.1] / src / lisp.h
index 2f16b85..4aee0e1 100644 (file)
@@ -218,7 +218,7 @@ typedef union
 # else
 /* C++ is annoying, but it has a big bag of tricks.
    The following doesn't have the "inside out" declaration bug C does. */
-template<class T> struct alignment_trick { char c; T member; };
+template<typename T> struct alignment_trick { char c; T member; };
 #  define ALIGNOF(type) offsetof (alignment_trick<type>, member)
 # endif
 #endif /* ALIGNOF */
@@ -267,7 +267,11 @@ void assert_failed (const char *, int, const char *);
 
 /* EMACS_INT is the underlying integral type into which a Lisp_Object must fit.
    In particular, it must be large enough to contain a pointer.
-   config.h can override this, e.g. to use `long long' for bigger lisp ints. */
+   config.h can override this, e.g. to use `long long' for bigger lisp ints.
+
+   #### In point of fact, it would NOT be a good idea for config.h to mess
+   with EMACS_INT.  A lot of code makes the basic assumption that EMACS_INT
+   is the size of a pointer. */
 
 #ifndef SIZEOF_EMACS_INT
 # define SIZEOF_EMACS_INT SIZEOF_VOID_P
@@ -354,7 +358,7 @@ typedef UChar UChar_ASCII;
 typedef int Emchar;
 
 /* Different ways of referring to a position in a buffer.  We use
-   the typedefs in preference to 'int' to make it clearer what
+   the typedefs in preference to 'EMACS_INT' to make it clearer what
    sort of position is being used.  See extents.c for a description
    of the different positions.  We put them here instead of in
    buffer.h (where they rightfully belong) to avoid syntax errors
@@ -376,6 +380,10 @@ typedef EMACS_INT Extcount;
 /*     structure/other typedefs    */
 /* ------------------------------- */
 
+/* Counts of bytes or array elements */
+typedef EMACS_INT Memory_count;
+typedef EMACS_INT Element_count;
+
 typedef struct lstream Lstream;
 
 typedef unsigned int face_index;
@@ -577,7 +585,7 @@ enum Lisp_Type
 
 #define INT_VALBITS (BITS_PER_EMACS_INT - INT_GCBITS)
 #define VALBITS (BITS_PER_EMACS_INT - GCBITS)
-#define EMACS_INT_MAX ((EMACS_INT) ((1UL << INT_VALBITS) -1UL))
+#define EMACS_INT_MAX ((EMACS_INT) ((1UL << (INT_VALBITS - 1)) -1UL))
 #define EMACS_INT_MIN (-(EMACS_INT_MAX) - 1)
 
 #ifdef USE_UNION_TYPE
@@ -1903,7 +1911,7 @@ extern EMACS_INT consing_since_gc;
 
 /* threshold for doing another gc */
 
-extern EMACS_INT gc_cons_threshold;
+extern Fixnum gc_cons_threshold;
 
 /* Structure for recording stack slots that need marking */
 
@@ -2150,20 +2158,40 @@ void staticpro (Lisp_Object *);
 /* var will not be saved at dump time */
 void staticpro_nodump (Lisp_Object *);
 
-/* Call dump_add_root_struct_ptr (&var, &desc) to dump the structure pointed to by `var'. */
+/* dump_add_root_struct_ptr (&var, &desc) dumps the structure pointed to by `var'. */
 #ifdef PDUMP
 void dump_add_root_struct_ptr (void *, const struct struct_description *);
 #else
 #define dump_add_root_struct_ptr(varaddr,descaddr) DO_NOTHING
 #endif
 
-/* Call dump_add_opaque (&var, size) to dump the opaque static structure `var'. */
+/* dump_add_opaque (&var, size) dumps the opaque static structure `var'. */
 #ifdef PDUMP
 void dump_add_opaque (void *, size_t);
 #else
 #define dump_add_opaque(varaddr,size) DO_NOTHING
 #endif
 
+/* Call dump_add_opaque_int (&int_var) to dump `int_var', of type `int'. */
+#ifdef PDUMP
+#define dump_add_opaque_int(int_varaddr) do {  \
+  int *dao_ = (int_varaddr); /* type check */  \
+  dump_add_opaque (dao_, sizeof (*dao_));      \
+} while (0)
+#else
+#define dump_add_opaque_int(int_varaddr) DO_NOTHING
+#endif
+
+/* Call dump_add_opaque_fixnum (&fixnum_var) to dump `fixnum_var', of type `Fixnum'. */
+#ifdef PDUMP
+#define dump_add_opaque_fixnum(fixnum_varaddr) do {    \
+  Fixnum *dao_ = (fixnum_varaddr); /* type check */    \
+  dump_add_opaque (dao_, sizeof (*dao_));              \
+} while (0)
+#else
+#define dump_add_opaque_fixnum(fixnum_varaddr) DO_NOTHING
+#endif
+
 /* Call dump_add_root_object (&var) to ensure that var is properly updated after pdump. */
 #ifdef PDUMP
 void dump_add_root_object (Lisp_Object *);
@@ -2426,7 +2454,7 @@ Lisp_Object decode_path (const char *);
 extern int noninteractive, noninteractive1;
 extern int fatal_error_in_progress;
 extern int preparing_for_armageddon;
-extern int emacs_priority;
+extern Fixnum emacs_priority;
 extern int running_asynch_code;
 extern int suppress_early_error_handler_backtrace;
 
@@ -3229,6 +3257,7 @@ extern Lisp_Object Qvariable_documentation, Qvariable_domain;
 extern Lisp_Object Qvoid_function, Qvoid_variable;
 extern Lisp_Object Qwindow_live_p, Qwrong_number_of_arguments;
 extern Lisp_Object Qwrong_type_argument, Qyes_or_no_p;
+extern Lisp_Object Qgtk;
 
 #define SYMBOL(fou) extern Lisp_Object fou
 #define SYMBOL_KEYWORD(la_cle_est_fou) extern Lisp_Object la_cle_est_fou