Skip to content

Commit

Permalink
Updated N8 main source file for Emscripten implementations.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Dec 17, 2024
1 parent f1d479a commit a56c965
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/N8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,18 @@
#include <iostream>
#include <stdexcept>

#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;
Expand Down Expand Up @@ -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

0 comments on commit a56c965

Please sign in to comment.