comparison src/lisp-disunion.h @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 3ecd8885ac67
children 3d3049ae1304
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
74 74
75 75
76 typedef EMACS_INT Lisp_Object; 76 typedef EMACS_INT Lisp_Object;
77 77
78 #define Lisp_Type_Int_Bit (Lisp_Type_Int_Even & Lisp_Type_Int_Odd) 78 #define Lisp_Type_Int_Bit (Lisp_Type_Int_Even & Lisp_Type_Int_Odd)
79 #define make_obj(vartype, x) ((Lisp_Object) (x)) 79 #define wrap_object(ptr) ((Lisp_Object) (ptr))
80 #define make_int(x) ((Lisp_Object) (((x) << INT_GCBITS) | Lisp_Type_Int_Bit)) 80 #define make_int(x) ((Lisp_Object) (((x) << INT_GCBITS) | Lisp_Type_Int_Bit))
81 #define make_char(x) ((Lisp_Object) (((x) << GCBITS) | Lisp_Type_Char)) 81 #define make_char(x) ((Lisp_Object) (((x) << GCBITS) | Lisp_Type_Char))
82 #define VALMASK (((1UL << VALBITS) - 1UL) << GCTYPEBITS) 82 #define VALMASK (((1UL << VALBITS) - 1UL) << GCTYPEBITS)
83 #define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) & ~VALMASK)) 83 #define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) & ~VALMASK))
84 #define XPNTRVAL(x) (x) /* This depends on Lisp_Type_Record == 0 */ 84 #define XPNTRVAL(x) (x) /* This depends on Lisp_Type_Record == 0 */
92 #define INT_MINUS1(x) INT_MINUS (x, make_int (1)) 92 #define INT_MINUS1(x) INT_MINUS (x, make_int (1))
93 93
94 #define Qzero make_int (0) 94 #define Qzero make_int (0)
95 #define Qnull_pointer ((Lisp_Object) 0) 95 #define Qnull_pointer ((Lisp_Object) 0)
96 #define EQ(x,y) ((x) == (y)) 96 #define EQ(x,y) ((x) == (y))
97 #define XSETINT(var, value) ((void) ((var) = make_int (value))) 97 #define XSETINT(var, value) ((void) ((var) = make_int (value)))
98 #define XSETCHAR(var, value) ((void) ((var) = make_char (value))) 98 #define XSETCHAR(var, value) ((void) ((var) = make_char (value)))
99 #define XSETOBJ(var, vartype, value) ((void) ((var) = make_obj (vartype, value))) 99 #define XSETOBJ(var, value) ((void) ((var) = wrap_object (value)))
100 100
101 /* Convert between a (void *) and a Lisp_Object, as when the 101 /* Convert between a (void *) and a Lisp_Object, as when the
102 Lisp_Object is passed to a toolkit callback function */ 102 Lisp_Object is passed to a toolkit callback function */
103 #define VOID_TO_LISP(larg,varg) ((void) ((larg) = ((Lisp_Object) (varg)))) 103 #define VOID_TO_LISP(larg,varg) ((void) ((larg) = ((Lisp_Object) (varg))))
104 #define CVOID_TO_LISP VOID_TO_LISP 104 #define CVOID_TO_LISP VOID_TO_LISP
105 #define LISP_TO_VOID(larg) ((void *) (larg)) 105 #define LISP_TO_VOID(larg) ((void *) (larg))
106 #define LISP_TO_CVOID(varg) ((CONST void *) (larg)) 106 #define LISP_TO_CVOID(varg) ((const void *) (larg))
107 107
108 /* Convert a Lisp_Object into something that can't be used as an 108 /* Convert a Lisp_Object into something that can't be used as an
109 lvalue. Useful for type-checking. */ 109 lvalue. Useful for type-checking. */
110 #define NON_LVALUE(larg) ((larg) + 0) 110 #define NON_LVALUE(larg) ((larg) + 0)