Prof A Olowofoyeku (The African Chief) wrote:
On 18 Jun 2004 at 15:17, Frank Heckenbach wrote:
Adriaan van Os wrote:
Frank Heckenbach wrote:
Kernel-safe!? Do you mean you want to implement a kernel in GPC using the runtime library?
Just a small "Hello Kernel" kernel extension, out of curiosity.
A kernel extension -- well, I only know about the Linux kernel, but you usually #include a number of kernel specific headers (which contain asm code, special #defines and other nontrivial stuff). Trying to translate them to Pascal might not be really nice unless we have a fully automatic header converter that also handles such constructs ...
Perhaps I am just being naïve/ignorant - but wouldn't it be possible to (somehow) compile the C headers into an intermediate (.gpi or .o or .whatever) file that GPC can use? We already have {$L foo.c} which calls the C compiler to produce an object file. Isn't there a way of extending this concept with header files?
Substantial parts of such headers are macro #defines which can't be (and IMHO shouldn't be) stored in GPI files.
For regular declarations, it may be just as easy/hard to convert them to Pascal declarations (i.e., header translator) and compile them, as to compile C declarations to GPI files directly, and the former seems to be somewhat more flexible.
Frank