[gambit-list] Gambit and termite on an embedded system (Nintendo DS)?
Andrew Lentvorski
bsder at allcaps.org
Mon Oct 23 06:51:00 EDT 2006
Marc Feeley wrote:
> I'll see if I can change the makefiles to make it easier to use Gambit
> as a cross-compiler (my idea is to use "gsc/gsc-comp" as the Gambit
> compiler to compile the .scm files in the source tree, and "gsc/gsc" is
> the target of the make; there will be an extra step needed to copy
> "gsc/gsc" to "gsc/gsc-comp" to bootstrap the system, obtained with a
> "make bootstrap").
If you wind up doing any refactoring of code, may I suggest an
adjustment to the debugging output statements?
It would make things nicer if the debugging fprintf calls were made to
your own function dbfprintf declared as follows in a separate file:
#include <stdio.h>
#include <stdarg.h>
int dbfprintf(FILE * fp, const char *fmt,...)
{
int ret;
va_list ap, ap2;
va_start (ap, fmt);
#if 0
/* Useful to create a copy of the output to somewhere else, too */
va_copy (ap2, ap);
vprintf(fmt, ap2);
va_end (ap2);
#endif
ret = vfprintf (fp, fmt, ap);
va_end (ap);
return ret;
}
I used this to be able to split output to both a logfile as well as
stdout. At various points, I used it to send the debug output to a
normal stream but which also wrote to a flash cartridge in a non-cached
fashion so that I could see when things crashed. It was *very* useful.
Thanks,
-a
More information about the Gambit-list
mailing list