21 lines
300 B
C++
21 lines
300 B
C++
#include <cstdint>
|
|
#include <cstring>
|
|
|
|
#if defined(__EMSCRIPTEN__)
|
|
#include <emscripten/emscripten.h>
|
|
#define WASM_EXPORT EMSCRIPTEN_KEEPALIVE
|
|
#else
|
|
#define WASM_EXPORT
|
|
#endif
|
|
|
|
extern "C" {
|
|
|
|
WASM_EXPORT int add(int a, int b) {
|
|
return a + b;
|
|
}
|
|
|
|
WASM_EXPORT int hello_version() {
|
|
return 1;
|
|
}
|
|
|
|
} |