Prof. A Olowofoyeku (The African Chief) wrote:
I think rts.c would be excellent, if it could be made entirely self- contained. I ran a "configure" on the rts directory and then built rts.c into rts.o. However, attempting to link it produced errors (because there were declarations from error.pas and some other .pas files). Is it possible to have a fully self-contained rts.c ?
Perhaps not fully, but somewhat more. Some things could be mapped to libc equivalents (e.g., some CString routines -- I currently use libc only where strictly needed, i.e. basically OS interfaces, which CString routines don't need, but one could use libc routines as well, perhaps via an optional define), or the heap management (_p_New etc. -- clearly we want to use the Pascal heap manager from within the RTS, but for a standalone version, they can simply be mapped to malloc() etc.). I plan to move most of realpath() to the Pascal side anyway and leave just the basic OS interface (readlink() etc.) in rts.c, which will also get rid of some dependencies. But a few will remain -- some can be nop'ped (such as _p_SetReturnAddress) when not needed, but some have to be provided and should not really be nops (such as _p_RuntimeError, for obvious reasons, I suppose ;-). So you need to provide simple substitutes at least (whether written in C or Pascal -- cf. RangeCheckError in my previous example).
Frank