Document about noinline calling convention and exportcpp pragma in Nim manual (#24323)

It seems exportcpp was implemented in v1.0 but there is no documentation
about it excepts changelog.
`noinline` is used in many procedures in Nim code but there is also no
documentation about it.

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Tomohiro
2024-10-18 14:39:20 +09:00
committed by GitHub
parent 52cf7dfde0
commit b8f6088ac0

View File

@@ -2241,6 +2241,10 @@ Nim supports these `calling conventions`:idx:\:
only a hint for the compiler: it may completely ignore it, and
it may inline procedures that are not marked as `inline`.
`noinline`:idx:
: The backend compiler may inline procedures that are not marked as `inline`.
The noinline convention prevents it.
`fastcall`:idx:
: Fastcall means different things to different C compilers. One gets whatever
the C `__fastcall` means.
@@ -8646,6 +8650,14 @@ pragma should be used in addition to the `exportc` pragma. See
[Dynlib pragma for export].
Exportcpp pragma
----------------
The `exportcpp` pragma works like the `exportc` pragma but it requires the `cpp` backend.
When compiled with the `cpp` backend, the `exportc` pragma adds `export "C"` to
the declaration in the generated code so that it can be called from both C and
C++ code. `exportcpp` pragma doesn't add `export "C"`.
Extern pragma
-------------
Like `exportc` or `importc`, the `extern` pragma affects name