mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user