mes: Unify mlibc-gcc and mes builds.

* make.scm (bin.gcc): Remove stray slash.
* src/mes.c: Unify mlibc-gcc and mes builds.
(gc_init_cells):
(gc_init_news):
(bload_env):
* src/reader.c (reader_read_character):
(reader_read_string):
This commit is contained in:
Jan Nieuwenhuizen 2018-04-13 08:18:19 +02:00
parent 3dc72ce20d
commit b200366f27
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
3 changed files with 9 additions and 9 deletions

View file

@ -443,7 +443,7 @@ exec ${GUILE-guile} --no-auto-compile -L . -L guile -C . -C guile -s "$0" ${1+"$
(add-target (bin.gcc "src/mes.c" #:libc libc-gcc.mlibc-o
#:dependencies mes-snarf-targets
#:defines `(,(string-append "VERSION=\"" %version "\"")
,(string-append "MODULEDIR=\"" (string-append %prefix (if (string-null? %prefix) "" "/") "/" %moduledir "/") "\"")
,(string-append "MODULEDIR=\"" (string-append %prefix (if (string-null? %prefix) "" "/") %moduledir "/") "\"")
,(string-append "PREFIX=\"" %prefix "\""))
#:includes '("src")))

View file

@ -25,7 +25,7 @@
#include <mlibc.h>
int ARENA_SIZE = 20000000; // 32B: 100 MiB, 64b: 200 MiB
#if __MESC__
#if 1 //__MESC__
int MAX_ARENA_SIZE = 172100000; // 32b: ~ 2GiB
#else
int MAX_ARENA_SIZE = 200000000; // 32b: 2.3GiB, 64b: 4.6GiB
@ -1521,7 +1521,7 @@ gc_init_cells () ///((internal))
TYPE (0) = TVECTOR;
LENGTH (0) = 1000;
VECTOR (0) = 0;
#if __MESC__
#if 0 //__MESC__
g_cells += sizeof (struct scm);
#else
g_cells++;
@ -1534,7 +1534,7 @@ gc_init_cells () ///((internal))
SCM
gc_init_news () ///((internal))
{
#if __MESC__
#if 0 //__MESC__
char *p = g_cells;
p -= sizeof (struct scm);
p += ARENA_SIZE * sizeof (struct scm);
@ -1546,7 +1546,7 @@ gc_init_news () ///((internal))
NTYPE (0) = TVECTOR;
NLENGTH (0) = 1000;
NVECTOR (0) = 0;
#if __MESC__
#if 0 //__MESC__
g_news += sizeof (struct scm);
#else
g_news++;
@ -1750,7 +1750,7 @@ load_env (SCM a) ///((internal))
SCM
bload_env (SCM a) ///((internal))
{
#if __MESC__
#if 1 //__MESC__
char *mo = "mes/read-0-32.mo";
g_stdin = open ("module/mes/read-0-32.mo", O_RDONLY);
char *read0 = MODULEDIR "mes/read-0-32.mo";

View file

@ -282,7 +282,7 @@ reader_read_character ()
else if (!strcmp (buf, "newline")) c = '\n';
else if (!strcmp (buf, "vtab")) c = '\v';
else if (!strcmp (buf, "page")) c = '\f';
#if __MESC__
#if 1 //__MESC__
//Nyacc bug
else if (!strcmp (buf, "return")) c = 13;
else if (!strcmp (buf, "esc")) c = 27;
@ -298,7 +298,7 @@ reader_read_character ()
else if (!strcmp (buf, "ht")) c = '\t';
else if (!strcmp (buf, "vt")) c = '\v';
#if __MESC__
#if 1 //__MESC__
//Nyacc bug
else if (!strcmp (buf, "cr")) c = 13;
#else
@ -390,7 +390,7 @@ reader_read_string ()
buf[i++] = '\t';
}
}
#if !__MESC__
#if 0 // !__MESC__
else if (c == EOF)
assert (!"EOF in string");
#endif