Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading