WebAssembly - accessing global constants from JavaScript

Viewed 38

I am writing an application where I need to share constants between C and JavaScript. At the moment I am doing so in the following way

C:

const int Up    = 1;
const int Left  = 2;
const int Down  = 3;
const int Right = 4;

JavaScript:

const Up    = 1;
const Left  = 2;
const Down  = 3;
const Right = 4;

Is it possible to export the constants from the *.wasm file as it can be done with functions? Could it be possible to export constants defined with #define?

0 Answers
Related