example/1227 exposes the sx fn `sx_triple` to C under the symbol `triple_c` via `export "triple_c"`; the companion C calls `triple_c` by that name. RED: the define path emits the fn under its sx name (`sx_triple`) and ignores the parsed `extern_name`, so the C reference to `triple_c` is undefined at AOT link. The next commit consumes the rename on the define path (gap iii) and greens it.
9 lines
200 B
C
9 lines
200 B
C
#include "1227-ffi-export-fn-rename.h"
|
|
|
|
// Defined on the sx side via `export "triple_c"` — a plain C-ABI symbol.
|
|
extern int triple_c(int n);
|
|
|
|
int call_triple(int n) {
|
|
return triple_c(n) + 1;
|
|
}
|