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 (add-target (bin.gcc "src/mes.c" #:libc libc-gcc.mlibc-o
#:dependencies mes-snarf-targets #:dependencies mes-snarf-targets
#:defines `(,(string-append "VERSION=\"" %version "\"") #: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 "\"")) ,(string-append "PREFIX=\"" %prefix "\""))
#:includes '("src"))) #:includes '("src")))

View File

@ -25,7 +25,7 @@
#include <mlibc.h> #include <mlibc.h>
int ARENA_SIZE = 20000000; // 32B: 100 MiB, 64b: 200 MiB int ARENA_SIZE = 20000000; // 32B: 100 MiB, 64b: 200 MiB
#if __MESC__ #if 1 //__MESC__
int MAX_ARENA_SIZE = 172100000; // 32b: ~ 2GiB int MAX_ARENA_SIZE = 172100000; // 32b: ~ 2GiB
#else #else
int MAX_ARENA_SIZE = 200000000; // 32b: 2.3GiB, 64b: 4.6GiB int MAX_ARENA_SIZE = 200000000; // 32b: 2.3GiB, 64b: 4.6GiB
@ -1521,7 +1521,7 @@ gc_init_cells () ///((internal))
TYPE (0) = TVECTOR; TYPE (0) = TVECTOR;
LENGTH (0) = 1000; LENGTH (0) = 1000;
VECTOR (0) = 0; VECTOR (0) = 0;
#if __MESC__ #if 0 //__MESC__
g_cells += sizeof (struct scm); g_cells += sizeof (struct scm);
#else #else
g_cells++; g_cells++;
@ -1534,7 +1534,7 @@ gc_init_cells () ///((internal))
SCM SCM
gc_init_news () ///((internal)) gc_init_news () ///((internal))
{ {
#if __MESC__ #if 0 //__MESC__
char *p = g_cells; char *p = g_cells;
p -= sizeof (struct scm); p -= sizeof (struct scm);
p += ARENA_SIZE * sizeof (struct scm); p += ARENA_SIZE * sizeof (struct scm);
@ -1546,7 +1546,7 @@ gc_init_news () ///((internal))
NTYPE (0) = TVECTOR; NTYPE (0) = TVECTOR;
NLENGTH (0) = 1000; NLENGTH (0) = 1000;
NVECTOR (0) = 0; NVECTOR (0) = 0;
#if __MESC__ #if 0 //__MESC__
g_news += sizeof (struct scm); g_news += sizeof (struct scm);
#else #else
g_news++; g_news++;
@ -1750,7 +1750,7 @@ load_env (SCM a) ///((internal))
SCM SCM
bload_env (SCM a) ///((internal)) bload_env (SCM a) ///((internal))
{ {
#if __MESC__ #if 1 //__MESC__
char *mo = "mes/read-0-32.mo"; char *mo = "mes/read-0-32.mo";
g_stdin = open ("module/mes/read-0-32.mo", O_RDONLY); g_stdin = open ("module/mes/read-0-32.mo", O_RDONLY);
char *read0 = MODULEDIR "mes/read-0-32.mo"; 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, "newline")) c = '\n';
else if (!strcmp (buf, "vtab")) c = '\v'; else if (!strcmp (buf, "vtab")) c = '\v';
else if (!strcmp (buf, "page")) c = '\f'; else if (!strcmp (buf, "page")) c = '\f';
#if __MESC__ #if 1 //__MESC__
//Nyacc bug //Nyacc bug
else if (!strcmp (buf, "return")) c = 13; else if (!strcmp (buf, "return")) c = 13;
else if (!strcmp (buf, "esc")) c = 27; 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, "ht")) c = '\t';
else if (!strcmp (buf, "vt")) c = '\v'; else if (!strcmp (buf, "vt")) c = '\v';
#if __MESC__ #if 1 //__MESC__
//Nyacc bug //Nyacc bug
else if (!strcmp (buf, "cr")) c = 13; else if (!strcmp (buf, "cr")) c = 13;
#else #else
@ -390,7 +390,7 @@ reader_read_string ()
buf[i++] = '\t'; buf[i++] = '\t';
} }
} }
#if !__MESC__ #if 0 // !__MESC__
else if (c == EOF) else if (c == EOF)
assert (!"EOF in string"); assert (!"EOF in string");
#endif #endif