How to remove the N_LIB_PRIVATE from exported c code.

2024-04-01 Thread ringabout
See also => dynlib keeps exported functions alive in emscripten

How to remove the N_LIB_PRIVATE from exported c code.

2024-04-01 Thread ringabout
Neat macros! Let me see whether I can make `__attribute__((used))`/`EMSCRIPTEN_KEEPALIVE` into `nimbase.h`

How to remove the N_LIB_PRIVATE from exported c code.

2024-04-01 Thread ElegantBeef
I am generally of the view packages should only be on a package registry if they're of sufficient quality. Which means have tests, and documentation. Since Nimble is decentralized there is not much reason to add what I consider incomplete packages.

How to remove the N_LIB_PRIVATE from exported c code.

2024-04-01 Thread Nlits
Is there any reason why your wasm3 package is not on nimble? I was going to make my own wasm runtime wrapper, but now that I know one exists I don’t need to. As for the emcc keep alive thing, I will see if I need to use it. (I might)

How to remove the N_LIB_PRIVATE from exported c code.

2024-04-01 Thread ElegantBeef
If you're sharing code with other languages the correct annotation is `cdecl, exportc, dynlib` though in many cases `nimcall` is compatible with `cdecl`

How to remove the N_LIB_PRIVATE from exported c code.

2024-04-01 Thread Nlits
**Successful: (with dynlib pragma)** N_LIB_EXPORT N_CDECL(NCSTRING, add_nfunc)(NCSTRING* nfuncsX60flatArgs__p0, NI nfuncsX60flatArgs__p0Len_0); Run WAST: (export "add_nfunc" (func $52)) Run 👍

How to remove the N_LIB_PRIVATE from exported c code.

2024-04-01 Thread Nlits
Should I use just exportc and dynlib or should I use cdecl as the docs say too?

How to remove the N_LIB_PRIVATE from exported c code.

2024-04-01 Thread ElegantBeef
You should use `exportc, dynlib` to ensure a procedure is not dead code removed. Depending on your wasm compiler you may also want to use `codegenDecl` to add the correct annotation to your procedure.

How to remove the N_LIB_PRIVATE from exported c code.

2024-04-01 Thread Nlits
I am using the `exportc` pragma to attempt to export to c then WASM, but the function never appears in the WASM and is generated with `N_LIB_PRIVATE` in the c code. Is there anyway to remove this or am I getting the cause of my issue completely wrong? (I found in the c code only the functions wi