Question regarding hybrid crunch/chicken code
"Ben Jakob" <[email protected]>
| Newsgroups | gmane.lisp.scheme.chicken |
|---|---|
| Message-ID | <[email protected]> |
Under the section https://wiki.call-cc.org/eggref/6/crunch#crunch-process-context :
For example, this program can be compiled and run with both CHICKEN and CRUNCH:
```
(module main (main)
(import (scheme base) (scheme write)
(crunch process-context))
(define (main)
(display "Hello, I'm ")
(display (vector-ref (command-line) 0))
(newline))
(cond-expand ((not crunched) (main)) (else)) )
```
While I can compile it with crunch, I cannot figure out how to compile this after with `cc`
```
cc -I.. test2.c
test2.c:33:28: error: call to undeclared function 'crunch_command_X2dline'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
33 | crunch_move(crunch_vector, crunch_command_X2dline(), t12);
| ^
test2.c:33:28: note: did you mean 'crunch_command_line'?
../crunch.h:2170:22: note: 'crunch_command_line' declared here
2170 | static crunch_vector crunch_command_line(void) {
| ^
test2.c:33:1: warning: cast to 'crunch_vector' (aka 'crunch_vector_block *') from smaller integer type 'int' [-Wint-to-pointer-cast]
33 | crunch_move(crunch_vector, crunch_command_X2dline(), t12);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../crunch.h:286:44: note: expanded from macro 'crunch_move'
286 | #define crunch_move(t, from, to) {t _tmp = (t)from; crunch_addref(_tmp); crunch_unref(to); to = _tmp;}
| ^~~~~~~
1 warning and 1 error generated.
```