freebsd-ports/lang/qscheme/files/patch-struct.c
Dmitry Marakasov f2bb29203c - Fix build with gcc 4.2
PR:		132287
Submitted by:	Vitaly Magerya <vmagerya at gmail dot com>
Approved by:	Erik Greenwald <erik dot greenwald at gmail dot com> (maintainer)
2009-04-01 22:31:31 +00:00

48 lines
1.2 KiB
C

--- struct.c.orig 2009-03-03 17:58:54.000000000 +0200
+++ struct.c 2009-03-03 18:02:57.000000000 +0200
@@ -24,8 +24,10 @@
ptr = scm_must_alloc(size);
size |= SCM_DBLOCK_ALLOCATED;
}
- SCM_DBLOCK_ADDR(new) = ptr;
- SCM_DBLOCK_SIZE(new) = size;
+ /*SCM_DBLOCK_ADDR(new) = ptr;
+ SCM_DBLOCK_SIZE(new) = size;*/
+ SCM_DBLOCK_ADDR_SET(new, ptr);
+ SCM_DBLOCK_SIZE_SET(new, size);
return(new);
}
@@ -33,8 +35,10 @@
{
if (SCM_DBLOCK_SIZE(x) & SCM_DBLOCK_ALLOCATED) {
scm_free(SCM_DBLOCK_ADDR(x));
- SCM_DBLOCK_ADDR(x) = NULL;
- SCM_DBLOCK_SIZE(x) = 0;
+ /*SCM_DBLOCK_ADDR(x) = NULL;
+ SCM_DBLOCK_SIZE(x) = 0;*/
+ SCM_DBLOCK_ADDR_SET(x, NULL);
+ SCM_DBLOCK_SIZE_SET(x, 0);
}
}
@@ -136,7 +140,8 @@
SOBJ scm_struct_def_new(int nfields)
{
SOBJ new = scm_newcell(SOBJ_T_STRUCT_DEF);
- SCM_STRUCT_DEF(new) = scm_struct_def_alloc(nfields);
+ /*SCM_STRUCT_DEF(new) = scm_struct_def_alloc(nfields);*/
+ SCM_STRUCT_DEF_SET(new, scm_struct_def_alloc(nfields));
return(new);
}
@@ -156,7 +161,8 @@
{
if (SCM_STRUCT_DEF(x)) {
scm_free(SCM_STRUCT_DEF(x));
- SCM_STRUCT_DEF(x) = NULL;
+ /*SCM_STRUCT_DEF(x) = NULL;*/
+ SCM_STRUCT_DEF_SET(x, NULL);
}
}