manual: documents changes regarding dynlib (#13425)

* manual: documents changes regarding dynlib

Closes #13416

* manual: clean up sentence phrasing
This commit is contained in:
alaviss 2020-02-18 18:44:54 +00:00 • committed by GitHub
commit d1f9f11245
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -7224,6 +7224,9 @@ The string literal passed to ``exportc`` can be a format string:
In the example the external name of ``p`` is set to ``prefixp``. Only ``$1``
is available and a literal dollar sign must be written as ``$$``.
If the symbol should also be exported to a dynamic library, the ``dynlib``
pragma should be used in addition to the ``exportc`` pragma. See
`Dynlib pragma for export <#foreign-function-interface-dynlib-pragma-for-export>`_.
Extern pragma
@ -7363,10 +7366,7 @@ conjunction with the ``exportc`` pragma:
proc exportme(): int {.cdecl, exportc, dynlib.}
This is only useful if the program is compiled as a dynamic library via the
``--app:lib`` command line option. This pragma only has an effect for the code
generation on the Windows target, so when this pragma is forgotten and the dynamic
library is only tested on Mac and/or Linux, there won't be an error. On Windows
this pragma adds ``__declspec(dllexport)`` to the function declaration.
``--app:lib`` command line option.