diff --git a/src/N8.cpp b/src/N8.cpp index a958ee6..1ed2d10 100644 --- a/src/N8.cpp +++ b/src/N8.cpp @@ -22,7 +22,18 @@ #include #include -#ifndef __EMSCRIPTEN__ +#ifdef __EMSCRIPTEN__ + +extern "C" { + +void executeSource(const char* sourceCode) { + Runtime::execute(sourceCode); + std::cout << std::flush; +} + +} + +#else auto printBanner(N8Util::ArgumentParser argParse) -> void { std::cout << N8_MAIN_BANNER << std::endl; @@ -84,15 +95,4 @@ auto main(int argc, char** argv) -> int { return 0; } -#else - -extern "C" { - -void executeSource(const char* outputElement, const char* sourceCode) { - Runtime::setOutputElementId(std::string(outputElement)); - Runtime::execute(sourceCode); -} - -} - #endif