* lib/libc+tcc.c (strncpy): New function.
* scaffold/tests/86-strncpy.c: Test it.
* build-aux/check-mescc.sh (tests): Run it.
* build-aux/cc-mlibc.sh (LIBC): Acknowlegde.
* build-aux/test.sh (LIBC): Export it.
* module/language/c99/compiler.mes (int->bv): New function.
(init->data): Use it. Add parameter. Update callers.
(array-init->data): Add type parmeter.
(array-init-element->data): Likewise.
* module/mes/bytevectors.mes (bytevector-u8-set!): New function.
* module/mes/bytevectors.scm (mes): Export it.
* module/mes/as.mes (int->bv8): New function.
* module/language/c99/compiler.mes (struct->fields): Support bit-fields.
(ast->type):
(field-field):
(field-offset):
(expr->accu*):
(expr->accu):
(struct-field):
(->size):
* module/language/c99/info.scm (<bit-field>): New type.
* stage0/x86.M1 (and____$i32,%eax, and____(%edx),%eax,
mov____(%edx),%eax, or____(%edx),%eax): New macro.
* module/mes/as-i386.mes (i386:base-mem->accu): Use
it.
(i386:accu-and, i386:accu-and-base-mem, i386:accu-or-base-mem): New
function.
* module/mes/as-i386.scm: Export them.
* scaffold/tests/7q-bit-field.c: Test it.
* build-aux/check-mescc.sh (tests): Run it.
* module/language/c99/compiler.mes (global->info): Anonymous string
array.
(local->info): Likewise.
(array-init->string): Support array of char.
(init-local): Likewise.
(->size): Fix for array.
* scaffold/tests/4a-char-array.c: Test it.
* build-aux/check-mescc.sh (tests): Run it.
* module/language/c99/info.scm (clone): Add post field.
(make): Handle post parameter.
* module/language/c99/compiler.mes (clone): Handle post parameter.
(expr->accu*): Set it to support foo--/foo--.
(expr->accu): Read it to support foo--/foo--.
* scaffold/tests/7o-struct-pre-post.c: Test it.
* build-aux/check-mescc.sh: Run it.
* module/language/c99/compiler.mes (struct-field): Return list of
fields. Update callers.
* scaffold/tests/84-struct-field-list.c: Test it.
* build-aux/check-mescc.sh (tests): Add it.
* module/language/c99/compiler.mes (decl->info): Support heterogeneous
variable init.
* scaffold/tests/83-heterogenoous-init.c: Test it.
* build-aux/check-mescc.sh (tests): Add it.
* module/language/c99/info.scm (make): Add statics field.
(<global>): Add name and function fields. Update callers.
(global->string): New function.
* module/mes/M1.mes (object->M1): Update.
* module/language/c99/compiler.mes (clone): Add statics field.
(ident->accu): For <global>, use global in text (WAS: name).
(ident-address->accu): Likewise.
(ident-address->base): Likewise.
(decl-local->info): New function.
(decl->info): New function.
(ast->info): Use them.
(function->info): Keep globals in object (WAS: global:value only).
* scaffold/tests/46-function-static.c: Test it.
* src/mes.c (append_reverse): New function.
(reverse_x_): New function.
(append2): Use them to create less garbage.
* module/mes/scm.mes (reverse): Create less garbage.
* module/srfi/srfi-1.mes (reverse!): Rewrite, use core:reverse!.
(append-reverse): Remove.
* GNUmakefile (OUT,QUIET,SUBDIRS): New variables.
include make/common.make
* .gitignore: Remove toplevel targets.
* build-aux/compile-all.scm: Import from GNU Guix.
* configure (gulp-pipe): Check exit status. Actually test for CC,
CC32.
* make/bin.make: New file.
* make/check.make: New file.
* make/clean.make: New file.
* make/common.make: New file.
* make/compile.make: New file.
* make/guile.make: New file.
* make/mescc-guile.make: New file.
* make/mescc-mes.make: New file.
* make/reset.make: New file.
* lib/mlibc.c: Rename from top.
* lib/start.c: Rename from top.
* module/module.make: New file.
* scaffold/scaffold.make: New file.
* scripts/scripts.make: New file.
* src/mes.c: Rename from top.
* src/src.make: New file.
* src/mes.c: Rename from top.
* src/gc..c: Rename from top.
* src/lib.c: Rename from top.
* src/posix.c: Rename from top.
* src/reader.c: Rename from top.
* src/vector.c: Rename from top.
* tests/tests.make: New file.
Mini-mes, compiled with either gcc or mescc, now runs a memory dump of
this mini-0.mes program
(begin
(write-byte (make-cell 0 0 65))
(write-byte (make-cell 0 0 66))
(write-byte (make-cell 0 0 67))
(write-byte (make-cell 0 0 10))
#f)
when read and dumped by (gcc-compiled) mes-32.
* build-aux/mes-snarf.scm: FIXES ..collapse?
* module/language/c99/compiler.mes (ast->info): Bail out on unhandled
declarations. Was: verbosely skip.
* posix.c (stderr_): New function.
* display.c: Remove.
* mes.c: Remove includes. Use stderr_ instead of display_.
(gc_loop): Preserve function's name.
(arity_): New function.
* GNUmakefile (mes.o): Remove dependency on display.
* module/mes/read-0.mes: Use core:stderr instead of display, newline.
(newline): New function.
* module/mes/base-0.mes: Use core:stderr instead of display.
Include (mes display).
* module/mes/display.mes: New file.
* lib.c (assert_defined): Move from mes.c.
(string_to_cstring): Move from posix.c
* build-aux/mes-snarf.scm (function-environment): Initialize function
name with scheme string.
* reader.c (lookup_): Rename from lookup. Remove all lookups except
for numbers and symbols. Update callers.
* mes.c (make_symbol_): Rename from internal_make_symbol. Update
callers.
* module/mes/read-0.mes (lookup): New function.
(read-word): Remove all lookup calls, except for numbers and symbols.
* build-aux/mes-snarf.scm (symbol->names): New function
(function->environment): Initialize symbol.
(generate-includes): Also write .symbol-names.i.
* mes.c (mes_symbols): Include it. Remove internal_lookup_symbol.
* display.c (display): Handle display of nil in symbol list.
* reader.c (internal_lookup_symbol): Remove name-fu.