summaryrefslogtreecommitdiff
path: root/lang/qscheme
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2009-04-01 22:31:31 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2009-04-01 22:31:31 +0000
commitf2bb29203cbb68f917b96c09b334257f80b63e10 (patch)
tree42a57a1560636bff450515434febabe35f0b756c /lang/qscheme
parent- Update to 23.0 (diff)
- 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)
Notes
Notes: svn path=/head/; revision=231450
Diffstat (limited to 'lang/qscheme')
-rw-r--r--lang/qscheme/Makefile7
-rw-r--r--lang/qscheme/files/patch-Makefile.in11
-rw-r--r--lang/qscheme/files/patch-chr.c14
-rw-r--r--lang/qscheme/files/patch-file.c27
-rw-r--r--lang/qscheme/files/patch-number.i42
-rw-r--r--lang/qscheme/files/patch-object.c107
-rw-r--r--lang/qscheme/files/patch-object.h16
-rw-r--r--lang/qscheme/files/patch-process.c20
-rw-r--r--lang/qscheme/files/patch-s.h34
-rw-r--r--lang/qscheme/files/patch-socket.c30
-rw-r--r--lang/qscheme/files/patch-sproto.h11
-rw-r--r--lang/qscheme/files/patch-struct.c48
-rw-r--r--lang/qscheme/files/patch-struct.h19
-rw-r--r--lang/qscheme/files/patch-thread.c42
-rw-r--r--lang/qscheme/files/patch-unix.c38
-rw-r--r--lang/qscheme/files/patch-vm2.c14
16 files changed, 467 insertions, 13 deletions
diff --git a/lang/qscheme/Makefile b/lang/qscheme/Makefile
index 9805d67a3ab7..5a04391b2414 100644
--- a/lang/qscheme/Makefile
+++ b/lang/qscheme/Makefile
@@ -7,7 +7,7 @@
PORTNAME= qscheme
PORTVERSION= 0.5.1
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= lang scheme
MASTER_SITES= http://www.sof.ch/dan/qscheme/files/
@@ -40,11 +40,8 @@ post-patch:
.include <bsd.port.pre.mk>
-.if ${OSVERSION} >= 700042
-BROKEN= Does not compile with GCC 4.2
-.endif
-
.if ${ARCH} == "ia64" || ${ARCH} == "amd64"
+# because it uses static pcre lib, which is compiled without -fPIC. pcre problem likely.
BROKEN= Does not build on amd64 or ia64
.endif
diff --git a/lang/qscheme/files/patch-Makefile.in b/lang/qscheme/files/patch-Makefile.in
index 045f49c73e79..2a1ff648ec27 100644
--- a/lang/qscheme/files/patch-Makefile.in
+++ b/lang/qscheme/files/patch-Makefile.in
@@ -1,5 +1,5 @@
---- Makefile.in.orig Thu Jun 22 19:10:21 2000
-+++ Makefile.in Fri Oct 29 10:07:48 2004
+--- Makefile.in.orig 2000-06-23 02:10:21.000000000 +0300
++++ Makefile.in 2009-03-03 18:30:51.000000000 +0200
@@ -111,7 +111,7 @@
EXTRA_DIST = mkoptable mkwhatis $(modsrc) $(scmsrc) CHANGES LICENCE_EXCEPTION
@@ -9,9 +9,12 @@
noinst_LIBRARIES = libqs.a
-@@ -580,10 +580,10 @@
+@@ -578,12 +578,12 @@
+ $(COMPILE) -o $@ -shared -fPIC -I$(incpcre) $(srcdir)/regex.c $(PCRE_LIB)
+
%.x:%.i
- mkoptable $< > $@
+- mkoptable $< > $@
++ ./mkoptable $< > $@
-sproto.h: $(libqs_src)
- @cfunctions $(libqs_src) \
diff --git a/lang/qscheme/files/patch-chr.c b/lang/qscheme/files/patch-chr.c
new file mode 100644
index 000000000000..845f368fbe2c
--- /dev/null
+++ b/lang/qscheme/files/patch-chr.c
@@ -0,0 +1,14 @@
+--- chr.c.orig 2009-03-03 16:47:01.000000000 +0200
++++ chr.c 2009-03-03 16:47:09.000000000 +0200
+@@ -15,11 +15,6 @@
+
+ #define BSLASH '\134'
+
+-struct CHR_SYM {
+- char *str;
+- char chr;
+-};
+-
+ struct CHR_SYM csym[] = {
+ { "null", 0 },
+ { "bell", '\a' },
diff --git a/lang/qscheme/files/patch-file.c b/lang/qscheme/files/patch-file.c
new file mode 100644
index 000000000000..a4f96dad40e6
--- /dev/null
+++ b/lang/qscheme/files/patch-file.c
@@ -0,0 +1,27 @@
+--- file.c.orig 2009-03-03 17:38:43.000000000 +0200
++++ file.c 2009-03-03 17:40:53.000000000 +0200
+@@ -7,11 +7,13 @@
+
+ #define SCM_FILE(x) (FILE *)(SCM_AUX(x))
+ #define SCM_FILEP(x) (SCM_OBJTYPE(x) == SOBJ_T_FILE)
++#define SCM_FILE_SET SCM_AUX_SET
+
+ SOBJ scm_file_new(FILE *fp)
+ {
+ SOBJ new = scm_newcell(SOBJ_T_FILE);
+- SCM_FILE(new) = fp;
++ /*SCM_FILE(new) = fp;*/
++ SCM_FILE_SET(new, fp);
+ return(new);
+ }
+
+@@ -77,7 +79,8 @@
+ int r;
+ if (!SCM_FILEP(x)) SCM_ERR("bad file", x);
+ r = fclose(SCM_FILE(x));
+- SCM_FILE(x) = NULL;
++ /*SCM_FILE_SET(x) = NULL;*/
++ SCM_FILE_SET(x, NULL);
+ return(SCM_MKINUM(r));
+ }
+
diff --git a/lang/qscheme/files/patch-number.i b/lang/qscheme/files/patch-number.i
new file mode 100644
index 000000000000..69e1924af5f5
--- /dev/null
+++ b/lang/qscheme/files/patch-number.i
@@ -0,0 +1,42 @@
+--- number.i.orig 2000-06-10 01:41:00.000000000 +0300
++++ number.i 2009-03-03 17:04:01.000000000 +0200
+@@ -562,7 +562,8 @@
+ Prim(plus1, "1+", 1)
+ {
+ if (SCM_INUMP(TOS) && (SCM_INUM(TOS) < SOBJ_INUM_MAX)) {
+- (long)TOS += (1 << SOBJ_INUM_SHIFT);
++ /*(long)TOS += (1 << SOBJ_INUM_SHIFT);*/
++ TOS = (long)TOS + (long)(1 << SOBJ_INUM_SHIFT);
+ NEXT;
+ }
+ TOS = scm_add2(SCM_MKINUM(1), TOS);
+@@ -574,7 +575,8 @@
+ Prim(plus2, "2+", 1)
+ {
+ if (SCM_INUMP(TOS) && (SCM_INUM(TOS) < SOBJ_INUM_MAX)) {
+- (long)TOS += (2 << SOBJ_INUM_SHIFT);
++ /*(long)TOS += (2 << SOBJ_INUM_SHIFT);*/
++ TOS = (long)TOS + (long)(2 << SOBJ_INUM_SHIFT);
+ NEXT;
+ }
+ TOS = scm_add2(SCM_MKINUM(2), TOS);
+@@ -586,7 +588,8 @@
+ Prim(minus1, "1-", 1)
+ {
+ if (SCM_INUMP(TOS) && (SCM_INUM(TOS) > SOBJ_INUM_MIN)) {
+- (long)TOS += (-1 << SOBJ_INUM_SHIFT);
++ /*(long)TOS += (-1 << SOBJ_INUM_SHIFT);*/
++ TOS = (long)TOS + (long)(-1 << SOBJ_INUM_SHIFT);
+ NEXT;
+ }
+ TOS = scm_sub2(TOS, SCM_MKINUM(1));
+@@ -598,7 +601,8 @@
+ Prim(minus2, "2-", 1)
+ {
+ if (SCM_INUMP(TOS) && (SCM_INUM(TOS) > SOBJ_INUM_MIN)) {
+- (long)TOS += (-2 << SOBJ_INUM_SHIFT);
++ /*(long)TOS += (-2 << SOBJ_INUM_SHIFT);*/
++ TOS = (long)TOS + (long)(-2 << SOBJ_INUM_SHIFT);
+ NEXT;
+ }
+ TOS = scm_sub2(TOS, SCM_MKINUM(2));
diff --git a/lang/qscheme/files/patch-object.c b/lang/qscheme/files/patch-object.c
new file mode 100644
index 000000000000..57e0fd446853
--- /dev/null
+++ b/lang/qscheme/files/patch-object.c
@@ -0,0 +1,107 @@
+--- object.c.orig 2009-03-03 17:41:46.000000000 +0200
++++ object.c 2009-03-03 17:58:19.000000000 +0200
+@@ -20,8 +20,10 @@
+ SOBJ scm_mkobjdef(int ndefs)
+ {
+ SOBJ new = scm_newcell(SOBJ_T_OBJDEF);
+- SCM_OBJDEF_AUX(new) =
+- scm_must_alloc(sizeof(SCM_ObjDefAux) + ((ndefs - 1) * sizeof(SCM_ObjDef)));
++ /*SCM_OBJDEF_AUX(new) =
++ scm_must_alloc(sizeof(SCM_ObjDefAux) + ((ndefs - 1) * sizeof(SCM_ObjDef)));*/
++ SCM_OBJDEF_AUX_SET(new,
++ scm_must_alloc(sizeof(SCM_ObjDefAux) + ((ndefs - 1) * sizeof(SCM_ObjDef))));
+
+ SCM_OBJDEF_AUX(new)->ndefs = ndefs;
+ return(new);
+@@ -43,7 +45,8 @@
+ {
+ if (SCM_OBJDEF_AUX(x)) {
+ scm_free(SCM_OBJDEF_AUX(x));
+- SCM_OBJDEF_AUX(x) = NULL;
++ /*SCM_OBJDEF_AUX(x) = NULL;*/
++ SCM_OBJDEF_AUX_SET(x, NULL);
+ }
+ }
+
+@@ -64,9 +67,12 @@
+ {
+ SOBJ new = scm_newcell(SOBJ_T_OBJECT);
+
+- SCM_OBJECT_DEF(new) = def;
++ /*SCM_OBJECT_DEF(new) = def;
+ SCM_OBJECT_VAL(new) =
+- scm_must_alloc(sizeof(SCM_ObjVal) + ((nslots - 1) * sizeof(SOBJ)));
++ scm_must_alloc(sizeof(SCM_ObjVal) + ((nslots - 1) * sizeof(SOBJ)));*/
++ SCM_OBJECT_DEF_SET(new, def);
++ SCM_OBJECT_VAL_SET(new,
++ scm_must_alloc(sizeof(SCM_ObjVal) + ((nslots - 1) * sizeof(SOBJ))));
+
+ SCM_OBJECT_VAL(new)->nslots = nslots;
+ return(new);
+@@ -237,7 +243,8 @@
+ int nslots;
+
+ if (SCM_OBJECT_VAL(obj) == NULL) {
+- SCM_OBJECT_VAL(obj) = scm_must_alloc(offsetof(SCM_ObjVal, slot[1]));
++ /*SCM_OBJECT_VAL(obj) = scm_must_alloc(offsetof(SCM_ObjVal, slot[1]));*/
++ SCM_OBJECT_VAL_SET(obj, scm_must_alloc(offsetof(SCM_ObjVal, slot[1])));
+ SCM_OBJECT_VAL(obj)->nslots = 1;
+ return(0);
+ }
+@@ -246,7 +253,9 @@
+ memcpy(ov, SCM_OBJECT_VAL(obj), offsetof(SCM_ObjVal, slot[nslots]));
+ ov->nslots++;
+ ov->slot[nslots] = NULL;
+- scm_free(SCM_OBJECT_VAL(obj)); SCM_OBJECT_VAL(obj) = ov;
++ scm_free(SCM_OBJECT_VAL(obj));
++ /*SCM_OBJECT_VAL(obj) = ov;*/
++ SCM_OBJECT_VAL_SET(obj, ov);
+ return(nslots);
+ }
+
+@@ -284,11 +293,13 @@
+ int nslots, size;
+ SOBJ new = scm_newcell(SOBJ_T_OBJECT);
+
+- SCM_OBJECT_DEF(new) = SCM_OBJECT_DEF(obj);
++ /*SCM_OBJECT_DEF(new) = SCM_OBJECT_DEF(obj);*/
++ SCM_OBJECT_DEF_SET(new, SCM_OBJECT_DEF(obj));
+
+ nslots = SCM_OBJECT_VAL(obj)->nslots;
+ size = offsetof(SCM_ObjVal, slot[nslots]);
+- SCM_OBJECT_VAL(new) = scm_must_alloc(size);
++ /*SCM_OBJECT_VAL(new) = scm_must_alloc(size);*/
++ SCM_OBJECT_VAL_SET(new, scm_must_alloc(size));
+ memcpy(SCM_OBJECT_VAL(new), SCM_OBJECT_VAL(obj), size);
+ return(new);
+ }
+@@ -377,7 +388,8 @@
+ /* make a new objdef with space for 2 more defs */
+ newdef = scm_newcell(SOBJ_T_OBJDEF);
+ d = objdef_append_fields(SCM_OBJDEF_AUX(olddef), 2);
+- SCM_OBJDEF_AUX(newdef) = d;
++ /*SCM_OBJDEF_AUX(newdef) = d;*/
++ SCM_OBJDEF_AUX_SET(newdef, d);
+
+ /* prepare atom for the set! name */
+ i = strlen(SCM_ATOM_NAME(name));
+@@ -414,7 +426,8 @@
+ if ((olddef = SCM_OBJECT_DEF(obj)) == NULL) SCM_ERR("bad objdef for object",obj);
+ newdef = scm_newcell(SOBJ_T_OBJDEF);
+ d = objdef_append_fields(SCM_OBJDEF_AUX(olddef), 1);
+- SCM_OBJDEF_AUX(newdef) = d;
++ /*SCM_OBJDEF_AUX_SET(newdef) = d;*/
++ SCM_OBJDEF_AUX_SET(newdef, d);
+
+ slotnr = object_new_slot(obj); /* alloc new slot and get index */
+
+@@ -424,7 +437,8 @@
+ d->def[i].type = type;
+ d->def[i].index= slotnr;
+
+- SCM_OBJECT_DEF(obj) = newdef; /* adjust object def pointer */
++ /*SCM_OBJECT_DEF(obj) = newdef;*/
++ SCM_OBJECT_DEF_SET(obj, newdef); /* adjust object def pointer */
+ SCM_OBJECT_SLOT(obj,slotnr) = value;
+ return(obj);
+ }
diff --git a/lang/qscheme/files/patch-object.h b/lang/qscheme/files/patch-object.h
new file mode 100644
index 000000000000..e43d1c211f1e
--- /dev/null
+++ b/lang/qscheme/files/patch-object.h
@@ -0,0 +1,16 @@
+--- object.h.orig 2009-03-03 17:43:57.000000000 +0200
++++ object.h 2009-03-03 17:54:10.000000000 +0200
+@@ -51,10 +51,13 @@
+
+ #define SCM_OBJECT_VAL(x) ((SCM_ObjVal*)(SCM_CAR(x)))
+ #define SCM_OBJECT_DEF(x) SCM_CDR(x)
++#define SCM_OBJECT_VAL_SET(x,v) (SCM_CAR(x)=(v))
++#define SCM_OBJECT_DEF_SET(x,v) (SCM_CDR(x)=(v))
+
+ /*** Accessing objdef fields */
+
+ #define SCM_OBJDEF_AUX(x) ((SCM_ObjDefAux*)(SCM_AUX(x)))
++#define SCM_OBJDEF_AUX_SET SCM_AUX_SET
+ #define SCM_OBJDEF_NDEFS(x) SCM_OBJDEF_AUX(x)->ndefs
+ #define SCM_OBJDEF_DEF(x,i) (SCM_OBJDEF_AUX(x)->def + i)
+
diff --git a/lang/qscheme/files/patch-process.c b/lang/qscheme/files/patch-process.c
new file mode 100644
index 000000000000..ecd3728c03bd
--- /dev/null
+++ b/lang/qscheme/files/patch-process.c
@@ -0,0 +1,20 @@
+--- process.c.orig 2000-06-01 22:30:18.000000000 +0300
++++ process.c 2009-03-03 17:37:30.000000000 +0200
+@@ -38,6 +38,7 @@
+
+ #define SCM_PROCESS(x) ((SCM_ProcessAux*)SCM_AUX(x))
+ #define SCM_PROCESSP(x) (SCM_OBJTYPE(x) == SOBJ_T_PROCESS)
++#define SCM_PROCESS_SET SCM_AUX_SET
+
+ #define SCM_PROCESS_PID(x) (SCM_PROCESS(x)->pid)
+ #define SCM_PROCESS_PORT(x,i) (SCM_PROCESS(x)->port[i])
+@@ -153,7 +154,8 @@
+ int i;
+ SOBJ new = scm_newcell(SOBJ_T_PROCESS);
+
+- SCM_PROCESS(new) = scm_must_alloc(sizeof(SCM_ProcessAux));
++ /*SCM_PROCESS_SET(new) = scm_must_alloc(sizeof(SCM_ProcessAux));*/
++ SCM_PROCESS_SET(new, scm_must_alloc(sizeof(SCM_ProcessAux)));
+ SCM_PROCESS_PID(new) = 0;
+ for (i = 0; i < 3; i++)
+ SCM_PROCESS_PORT(new, i) = NULL;
diff --git a/lang/qscheme/files/patch-s.h b/lang/qscheme/files/patch-s.h
index 6797b6926a87..aa68f70c921c 100644
--- a/lang/qscheme/files/patch-s.h
+++ b/lang/qscheme/files/patch-s.h
@@ -1,5 +1,5 @@
---- s.h.orig Sun Feb 10 12:45:20 2002
-+++ s.h Sun Feb 10 12:45:32 2002
+--- s.h.orig 2000-06-16 00:15:42.000000000 +0300
++++ s.h 2009-03-03 17:35:11.000000000 +0200
@@ -203,7 +203,7 @@
#ifdef SCM_WITH_THREADS
@@ -8,3 +8,33 @@
+#define SCM_SIG_SUSPEND SIGUSR1
#define SCM_SIG_RESUME SIGXCPU
#endif
+
+@@ -539,6 +539,7 @@
+ #define SCM_CATCH_CONTEXT_UNWIND(x) SCM_CATCH_CONTEXT(x)->unwind
+
+ #define SCM_AUX(x) SCM_VALUE(x,aux,aux)
++#define SCM_AUX_SET(x,v) SCM_VALUE(x,aux,aux)=(v);
+
+ /*-- type predicates */
+ /*#define SCM_OBJTYPE(x) (SCM_INUMP(x)?SOBJ_T_INUM:(x?SCM_OBJREF(x)->type:-1)) */
+@@ -656,6 +657,11 @@
+ SCM_ERR_THROW,
+ SCM_ERR_MAX };
+
++struct CHR_SYM {
++ char *str;
++ char chr;
++};
++
+ #include "sproto.h"
+
+ #define scm_sp scm_vmd()->reg.sp
+@@ -668,6 +674,8 @@
+ #define SCM_THREAD(x) ((SCM_VMD*)(SCM_AUX(x)))
+ #define SCM_MUTEX(x) ((pthread_mutex_t *)SCM_AUX(x))
+ #define SCM_SEMAPHORE(x) ((sem_t *)SCM_AUX(x))
++#define SCM_MUTEX_SET SCM_AUX_SET
++#define SCM_SEMAPHORE_SET SCM_AUX_SET
+
+ #define SCM_THREADP(x) (SCM_OBJTYPE(x) == SOBJ_T_THREAD)
+ #define SCM_MUTEXP(x) (SCM_OBJTYPE(x) == SOBJ_T_MUTEX)
diff --git a/lang/qscheme/files/patch-socket.c b/lang/qscheme/files/patch-socket.c
new file mode 100644
index 000000000000..b6c7efd92c92
--- /dev/null
+++ b/lang/qscheme/files/patch-socket.c
@@ -0,0 +1,30 @@
+--- socket.c.orig 2009-03-03 18:05:10.000000000 +0200
++++ socket.c 2009-03-03 18:07:34.000000000 +0200
+@@ -25,6 +25,7 @@
+
+ #define SCM_SOCKETP(x) (SCM_OBJTYPE(x) == SOBJ_T_SOCKET)
+ #define SCM_SOCKET(x) ((SCM_SocketAux*)SCM_AUX(x))
++#define SCM_SOCKET_SET SCM_AUX_SET
+
+ /* report system error */
+ static void system_error(char *msg)
+@@ -39,7 +40,8 @@
+ {
+ SOBJ new;
+ new = scm_newcell(SOBJ_T_SOCKET);
+- SCM_SOCKET(new) = scm_must_alloc(sizeof(SCM_SocketAux));
++ /*SCM_SOCKET(new) = scm_must_alloc(sizeof(SCM_SocketAux));*/
++ SCM_SOCKET_SET(new, scm_must_alloc(sizeof(SCM_SocketAux)));
+ memset(SCM_SOCKET(new), 0, sizeof(SCM_SocketAux));
+ return(new);
+ }
+@@ -323,7 +325,8 @@
+ /* scm_puts("; sweeping socket "); scm_cprint(x); */
+ scm_socket_shutdown2(x, 1);
+ scm_free(SCM_SOCKET(x));
+- SCM_SOCKET(x) = NULL;
++ /*SCM_SOCKET(x) = NULL;*/
++ SCM_SOCKET_SET(x, NULL);
+ }
+ }
+
diff --git a/lang/qscheme/files/patch-sproto.h b/lang/qscheme/files/patch-sproto.h
new file mode 100644
index 000000000000..bf9be15d530c
--- /dev/null
+++ b/lang/qscheme/files/patch-sproto.h
@@ -0,0 +1,11 @@
+--- sproto.h.orig 2000-06-23 03:10:23.000000000 +0400
++++ sproto.h 2009-04-01 20:17:48.000000000 +0400
+@@ -619,7 +619,7 @@
+ void scm_dump_env (SOBJ e );
+ void scm_vmfunc_mark (SOBJ obj );
+ void scm_vmfunc_sweep (SOBJ obj );
+-inline void scm_vm_move_stack (SOBJ *dst , SOBJ *src , int nitems );
++void scm_vm_move_stack (SOBJ *dst , SOBJ *src , int nitems );
+ void scm_vm (SCM_VMD *vm );
+ void scm_engine_init PROTO ((void));
+ SOBJ scm_run_engine (SOBJ *ip );
diff --git a/lang/qscheme/files/patch-struct.c b/lang/qscheme/files/patch-struct.c
new file mode 100644
index 000000000000..71b43572c21b
--- /dev/null
+++ b/lang/qscheme/files/patch-struct.c
@@ -0,0 +1,48 @@
+--- 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);
+ }
+ }
+
diff --git a/lang/qscheme/files/patch-struct.h b/lang/qscheme/files/patch-struct.h
new file mode 100644
index 000000000000..68e078675336
--- /dev/null
+++ b/lang/qscheme/files/patch-struct.h
@@ -0,0 +1,19 @@
+--- struct.h.orig 2009-03-03 17:59:24.000000000 +0200
++++ struct.h 2009-03-03 18:02:41.000000000 +0200
+@@ -10,6 +10,8 @@
+ #define SCM_DBLOCKP(x) (SCM_OBJTYPE(x) == SOBJ_T_DBLOCK)
+ #define SCM_DBLOCK_ADDR(x) ((void*)SCM_CAR(x))
+ #define SCM_DBLOCK_SIZE(x) ((long)(SCM_CDR(x)))
++#define SCM_DBLOCK_ADDR_SET(x,v) (SCM_CAR(x)=(v))
++#define SCM_DBLOCK_SIZE_SET(x,v) (SCM_CDR(x)=(v))
+
+ #define SCM_DBLOCK_ALLOCATED (1L << ((sizeof(long)*8)-1))
+ #define SCM_DBLOCK_SIZE_MASK ~(SCM_DBLOCK_ALLOCATED)
+@@ -34,6 +36,7 @@
+
+ #define SCM_STRUCT_DEFP(x) (SCM_OBJTYPE(x) == SOBJ_T_STRUCT_DEF)
+ #define SCM_STRUCT_DEF(x) ((SCM_StructDefAux *)SCM_AUX(x))
++#define SCM_STRUCT_DEF_SET SCM_AUX_SET
+
+ /*** Instance of a struct:
+ * - car points to struct def object,
diff --git a/lang/qscheme/files/patch-thread.c b/lang/qscheme/files/patch-thread.c
new file mode 100644
index 000000000000..a398a254ee38
--- /dev/null
+++ b/lang/qscheme/files/patch-thread.c
@@ -0,0 +1,42 @@
+--- thread.c.orig 2009-03-03 17:22:45.000000000 +0200
++++ thread.c 2009-03-03 17:26:27.000000000 +0200
+@@ -123,7 +123,8 @@
+ SOBJ scm_mutex_new()
+ {
+ SOBJ new = scm_newcell(SOBJ_T_MUTEX);
+- SCM_MUTEX(new) = scm_must_alloc(sizeof(pthread_mutex_t));
++ /*SCM_MUTEX(new) = scm_must_alloc(sizeof(pthread_mutex_t));*/
++ SCM_MUTEX_SET(new, scm_must_alloc(sizeof(pthread_mutex_t)));
+ pthread_mutex_init(SCM_MUTEX(new), NULL);
+ return(new);
+ }
+@@ -137,7 +138,8 @@
+ } else {
+ scm_free(SCM_MUTEX(x));
+ }
+- SCM_MUTEX(x) = NULL;
++ /*SCM_MUTEX(x) = NULL;*/
++ SCM_MUTEX_SET(x, NULL);
+ }
+ }
+
+@@ -201,7 +203,8 @@
+ {
+ int n = 0;
+ SOBJ new = scm_newcell(SOBJ_T_SEMAPHORE);
+- SCM_SEMAPHORE(new) = scm_must_alloc(sizeof(sem_t));
++ /*SCM_SEMAPHORE_SET(new) = scm_must_alloc(sizeof(sem_t));*/
++ SCM_SEMAPHORE_SET(new, scm_must_alloc(sizeof(sem_t)));
+ if (nargs >= 1 && SCM_INUMP(arg[0])) {
+ n = SCM_INUM(n);
+ }
+@@ -218,7 +221,8 @@
+ } else {
+ scm_free(SCM_SEMAPHORE(x));
+ }
+- SCM_SEMAPHORE(x) = NULL;
++ /*SCM_SEMAPHORE(x) = NULL;*/
++ SCM_SEMAPHORE_SET(x, NULL);
+ }
+ }
+
diff --git a/lang/qscheme/files/patch-unix.c b/lang/qscheme/files/patch-unix.c
new file mode 100644
index 000000000000..4d1c86bd8d0c
--- /dev/null
+++ b/lang/qscheme/files/patch-unix.c
@@ -0,0 +1,38 @@
+--- unix.c.orig 2009-03-03 18:14:22.000000000 +0200
++++ unix.c 2009-03-03 18:17:18.000000000 +0200
+@@ -283,12 +283,14 @@
+
+ #define SCM_DIRP(x) (SCM_OBJTYPE(x) == SOBJ_T_DIR)
+ #define SCM_DIR(x) (DIR *)SCM_AUX(x)
++#define SCM_DIR_SET SCM_AUX_SET
+
+ void scm_dir_sweep(SOBJ x)
+ {
+ if (SCM_DIR(x) != NULL) {
+ closedir(SCM_DIR(x));
+- SCM_DIR(x) = NULL;
++ /*SCM_DIR(x) = NULL;*/
++ SCM_DIR_SET(x, NULL);
+ }
+ }
+
+@@ -300,7 +302,8 @@
+ if (!SCM_STRINGP(name)) SCM_ERR("bad dir name", name);
+ if ((dir = opendir(SCM_STR_VALUE(name))) != NULL) {
+ new = scm_newcell(SOBJ_T_DIR);
+- SCM_DIR(new) = dir;
++ /*SCM_DIR(new) = dir;*/
++ SCM_DIR_SET(new, dir);
+ return(new);
+ }
+ return(scm_false);
+@@ -312,7 +315,8 @@
+ if (!SCM_DIRP(dir)) SCM_ERR("bad dir", dir);
+ if (SCM_DIR(dir) == NULL) SCM_ERR("already closed", dir);
+ r = closedir(SCM_DIR(dir));
+- SCM_DIR(dir) = NULL;
++ /*SCM_DIR(dir) = NULL;*/
++ SCM_DIR_SET(dir, NULL);
+ return(SCM_MKBOOL(r == 0));
+ }
+
diff --git a/lang/qscheme/files/patch-vm2.c b/lang/qscheme/files/patch-vm2.c
index d4340b993641..38fd7e282f04 100644
--- a/lang/qscheme/files/patch-vm2.c
+++ b/lang/qscheme/files/patch-vm2.c
@@ -1,5 +1,5 @@
---- vm2.c.orig Wed Oct 27 19:33:03 2004
-+++ vm2.c Wed Oct 27 19:33:16 2004
+--- vm2.c.orig 2000-06-01 17:47:00.000000000 +0300
++++ vm2.c 2009-03-03 17:12:14.000000000 +0200
@@ -185,8 +185,8 @@
#define RETURN(value) { TOS=(value); NEXT; }
@@ -11,3 +11,13 @@
/****************************************************************
+@@ -392,7 +392,8 @@
+ ef = (SCM_EnvFrame*)sp; \
+ /* alloc space on stack for an env object and fill it's frame and \
+ next fields */ \
+- ((void*)sp) -= sizeof(Sobject); \
++ /*((void*)sp) -= sizeof(Sobject);*/ \
++ sp = ((void*)sp) - sizeof(Sobject); \
+ SCM_ENV_FRAME((SOBJ)sp) = ef; \
+ SCM_ENV_NEXT((SOBJ)sp) = nextenv; \
+ env = (SOBJ)sp; \