Extend the export feature in the CFFI module to support exporting to a particular package.

This commit is contained in:
David Xu 2015-08-05 21:54:51 -04:00
commit c1fad12bdb
2 changed files with 9 additions and 2 deletions

View file

@ -4,3 +4,7 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 3.0.8 (in progress)
===========================
2015-08-05: lyze
[CFFI] Extend the "export" feature in the CFFI module to support
exporting to a specified package.

View file

@ -860,8 +860,11 @@ void CFFI::emit_struct_union(Node *n, bool un = false) {
}
void CFFI::emit_export(Node *n, String *name) {
if (GetInt(n, "feature:export"))
Printf(f_cl, "\n(cl:export '%s)\n", name);
if (GetInt(n, "feature:export")) {
String* package = Getattr(n, "feature:export:package");
Printf(f_cl, "\n(cl:export '%s%s%s)\n", name, package ? " " : "",
package ? package : "");
}
}
void CFFI::emit_inline(Node *n, String *name) {