Hi,

Given this example code:

#include <iostream>
#include <emscripten.h>

#define MYINT64 uint64_t

extern "C" void EMSCRIPTEN_KEEPALIVE bar (MYINT64 n) {
    std::cout << "C++ called from JS: " << n << std::endl;
}

EM_JS(void, foo, (MYINT64 i), {
    console.log("JS", i, typeof(i));

    Module.ccall('bar', null, ['number'], [i]);
});

int main() {
    auto some = std::numeric_limits<MYINT64>::max();
    std::cout << "C++ " << some << std::endl;
    foo(some);
}

The code prints:

C++ 18446744073709551615
JS -1n bigint
C++ called from JS: 18446744073709551615

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/f3675932-cff2-430f-a8fb-33e45aa9f649n%40googlegroups.com.

Reply via email to