added --nimMainPrefix switch; fixes #15955; refs #16945 [backport:1.6] (#19235)

This commit is contained in:
Andreas Rumpf 2021-12-10 14:28:59 +01:00 • committed by GitHub
commit 7ff43d07b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 17 deletions

View file

@ -246,6 +246,9 @@ Also, C code requires you to specify a forward declaration for functions or
the compiler will assume certain types for the return value and parameters
which will likely make your program crash at runtime.
The name `NimMain` can be influenced via the `--nimMainPrefix:prefix` switch.
Use `--nimMainPrefix:MyLib` and the function to call is named `MyLibNimMain`.
Nim invocation example from C
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~