> As far as I understand the question (probably not really), a simple way to > do this is to (foreign-declare "#include \"foo.c\"") and add foo.h to the > source-dependencies of the file (see for example the simple-sha1 and > simple-md5 eggs, they do this). No need for any special handling. > > Of course it means your C files get a lot larger, and you don't benefit > from reduced compilation times from separate compilation.
That's right, this will work in many cases. On the other hand, foo.c will be compiled in the environment that chicken.h defines, including all macro and type definitions, which may pollute what foo.c expects to be seen. "Reparing" the environment may range from difficult to impossible should foo.c have name clashes with anything defined in chicken.h. Moreover, foo.c may need special compilation flags that are not compatible with CHICKEN-generated source code. The foreign-declare case is simple and straightforward and should be used, if possible, but we need a fallback solution and this case of a separate .c file is common enough to be addressed. felix _______________________________________________ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers