Skip to content

Commit

Permalink
Document about noinline calling convention and exportcpp pragma in Ni…
Browse files Browse the repository at this point in the history
…m 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 <[email protected]>
  • Loading branch information
demotomohiro and Araq authored Oct 18, 2024
1 parent 52cf7df commit b8f6088
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b8f6088

Please sign in to comment.