1
#define EQ(x,y) ((x)==(y))
3
#define CMPmake_fixnum(x) make_fixnum(x)
6
/* copy x to y, increasing space by factor of 2 */
12
#define otoi(x) (integ_temp = (x) , (type_of(integ_temp) == t_bignum \
13
? MP(integ_temp) :stoi(fix(integ_temp))))
15
#define ISETQ_FIX(a,b,c) isetq_fix(a,c)
18
#define SETQ_II(var,alloc,val) \
20
int _n = replace_copy1(_xx,var); \
21
if(_n) var = replace_copy2(_xx,alloca(_n));}while(0)
23
#define SETQ_IO(var,alloc,val) {object _xx =(val) ; \
24
int _n = obj_replace_copy1(_xx,var); \
25
if(_n) var = obj_replace_copy2(_xx,alloca(_n));}
26
#define IDECL(a,b,c) our_ulong b[4];a =(b[0]=0x1010000 +4,b) ; object c
28
GEN setq_io(),setq_ii();
29
#define SETQ_IO(x,alloc,val) (x)=setq_io(x,&alloc,val)
30
#define SETQ_II(x,alloc,val) (x)=setq_ii(x,&alloc,val)
31
#define IDECL(a,b,c) our_ulong b[4];a =(b[0]=0x1010000 +4,b);object c
38
int obj_to_mpz(object,MP_INT *);
39
int obj_to_mpz1(object,MP_INT *,void *);
40
int mpz_to_mpz(MP_INT *,MP_INT *);
41
int mpz_to_mpz1(MP_INT *,MP_INT *,void *);
42
void isetq_fix(MP_INT *,int);
43
MP_INT * otoi(object x);
46
#error Need alloca for GMP
49
/* Add fourth argument af to the SETQ macros to allow for malloc allocation */
50
/* inside setjmp frames, and faster alloca allocation otherwise.*/
51
/* FIXME, verify that IDECL need not be changed, improve logic behind malloc */
52
/* selection, e.g. closure boundaries. CM 20031201*/
53
#define IDECL(a,b,c) mp_limb_t *c=(mp_limb_t *)alloca(1*sizeof(mp_limb_t));MP_INT b={1,1,c}; a = &b
54
#define SETQ_IO(var,alloc,val,af) { object _xx = (val); \
56
if ((_n=obj_to_mpz(_xx,(var)))) {\
57
obj_to_mpz1(_xx,(var),af(_n));}}
58
#define SETQ_II(var,alloc,val,af) { MP_INT * _xx = (val); \
60
if ((_n=mpz_to_mpz(_xx,(var)))) {\
61
mpz_to_mpz1(_xx,(var),af(_n));}}
62
#define ISETQ_FIX(a,b,c) isetq_fix(a,c)
65
/* #define IDECL(a,b,c) MP_INT b; a = (mpz_init(&b),&b) ; object c */
66
/* #define SETQ_IO(var,alloc,val) { object _xx = (val); \ */
67
/* obj_to_mpz(_xx,(var));} */
68
/* #define SETQ_II(var,alloc,val) { MP_INT * _xx = (val); \ */
69
/* mpz_to_mpz(_xx,(var));} */
70
/* #define ISETQ_FIX(a,b,c) isetq_fix(a,c) */
73
#endif /* end no GMP */
75
#define cclosure_call funcall