1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
$NetBSD: patch-ab,v 1.3 2004/05/23 23:28:29 danw Exp $
--- scheme.c.orig Tue Jan 7 14:40:51 2003
+++ scheme.c
@@ -57,9 +57,7 @@
#include <string.h>
#include <stdlib.h>
-#ifndef macintosh
-# include <malloc.h>
-#else
+#ifdef macintosh
static int stricmp(const char *s1, const char *s2)
{
unsigned char c1, c2;
@@ -91,8 +89,16 @@ static const char *strlwr(char *s) {
# define prompt "> "
#endif
+#ifndef TINYSCHEMEPREFIX
+# define TINYSCHEMEPREFIX ""
+#endif
+
+#ifndef TINYSCHEMEDIR
+# define TINYSCHEMEDIR ""
+#endif
+
#ifndef InitFile
-# define InitFile "init.scm"
+# define InitFile TINYSCHEMEPREFIX TINYSCHEMEDIR "init.scm"
#endif
#ifndef FIRST_CELLSEGS
@@ -569,7 +575,7 @@ static int alloc_cellseg(scheme *sc, int
i = ++sc->last_cell_seg ;
sc->alloc_seg[i] = cp;
/* adjust in TYPE_BITS-bit boundary */
- if(((int)cp)%adj!=0) {
+ if(((long)cp)%adj!=0) {
cp=(char*)(adj*((long)cp/adj+1));
}
/* insert new segment in address order */
@@ -2055,7 +2061,7 @@ struct dump_stack_frame {
static void s_save(scheme *sc, enum scheme_opcodes op, pointer args, pointer code)
{
- int nframes = (int)sc->dump;
+ long nframes = (long)sc->dump;
struct dump_stack_frame *next_frame;
/* enough room for the next frame? */
@@ -2075,7 +2081,7 @@ static void s_save(scheme *sc, enum sche
static pointer _s_return(scheme *sc, pointer a)
{
- int nframes = (int)sc->dump;
+ long nframes = (long)sc->dump;
struct dump_stack_frame *frame;
sc->value = (a);
@@ -2115,7 +2121,7 @@ static void dump_stack_free(scheme *sc)
static INLINE void dump_stack_mark(scheme *sc)
{
- int nframes = (int)sc->dump;
+ long nframes = (long)sc->dump;
int i;
for(i=0; i<nframes; i++) {
struct dump_stack_frame *frame;
|