~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to h/cmponly.h

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#define EQ(x,y) ((x)==(y))
 
2
 
 
3
#define CMPmake_fixnum(x) make_fixnum(x)
 
4
 
 
5
object make_integer();
 
6
  /* copy x to y, increasing space by factor of 2  */
 
7
 
 
8
#ifndef GMP
 
9
GEN otoi();
 
10
/*
 
11
object integ_temp;
 
12
#define otoi(x) (integ_temp = (x) , (type_of(integ_temp) == t_bignum \
 
13
   ? MP(integ_temp) :stoi(fix(integ_temp))))
 
14
*/
 
15
#define ISETQ_FIX(a,b,c) isetq_fix(a,c)
 
16
void isetq_fix();
 
17
#ifdef HAVE_ALLOCA
 
18
#define SETQ_II(var,alloc,val) \
 
19
  do{GEN _xx =(val) ; \
 
20
  int _n = replace_copy1(_xx,var); \
 
21
  if(_n) var = replace_copy2(_xx,alloca(_n));}while(0)
 
22
 
 
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
 
27
#else
 
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
 
32
#endif
 
33
 
 
34
#else
 
35
 
 
36
typedef MP_INT * GEN;
 
37
 
 
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);
 
44
 
 
45
#ifndef HAVE_ALLOCA
 
46
#error Need alloca for GMP
 
47
#endif
 
48
 
 
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); \
 
55
                                    int _n; \
 
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); \
 
59
                                    int _n; \
 
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)
 
63
 
 
64
 
 
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) */
 
71
 
 
72
 
 
73
#endif /* end no GMP */
 
74
 
 
75
#define cclosure_call   funcall
 
76