make null-extern no-extern, which throws an error

This commit is contained in:
2021-10-12 13:44:15 -06:00
parent 2b26b94edf
commit 547082c512
2 changed files with 4 additions and 5 deletions

View File

@@ -794,12 +794,11 @@ class Macros {
wholeExp.checkNumArgs(4, null, "(#extern <BodyType> <lang> <?compileArgs object> [<typed bindings...>] <body...>)");
var b = wholeExp.expBuilder();
// Skip all extern code generation if -D null-extern is provided to the compiler
if (Context.defined("null-extern")) {
return b.symbol("null");
// Skip all extern code generation if -D no-extern is provided to the compiler
if (Context.defined("no-extern")) {
return b.callSymbol("throw", [b.str("tried to call #extern code when -D no-extern was provided during compilation")]);
}
var bodyType = exps.shift();
var langExp = exps.shift();
var originalLang = langExp.symbolNameValue();

View File

@@ -37,7 +37,7 @@ class Main {
// kiss implement [type] [fromLib]
var _pwd = args.pop();
var theInterface = args.shift();
var pArgs = ["-D", "null-extern", "build-scripts/common-args.hxml", "-lib", "kiss"];
var pArgs = ["-D", "no-extern", "build-scripts/common-args.hxml", "-lib", "kiss"];
// pass --lib and the lib containing the interface as specified
if (args.length > 0) {
pArgs = pArgs.concat(["-lib", args.shift()]);