diff options
author | alaviss <alaviss@users.noreply.github.com> | 2020-02-18 18:44:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-18 19:44:54 +0100 |
commit | d1f9f11245a29f00bfa8cd86f9b4eb4ab0963a15 (patch) | |
tree | ae724886f93ef81b82da30d30ef1c31e0dad3841 | |
parent | 046bb0b881b1e4917fd0ff230f9d716d31f1f20c (diff) | |
download | Nim-d1f9f11245a29f00bfa8cd86f9b4eb4ab0963a15.tar.gz |
manual: documents changes regarding dynlib (#13425)
* manual: documents changes regarding dynlib Closes #13416 * manual: clean up sentence phrasing
-rw-r--r-- | changelog.md | 4 | ||||
-rw-r--r-- | doc/manual.rst | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/changelog.md b/changelog.md index 33be5da21..ad18bec6b 100644 --- a/changelog.md +++ b/changelog.md @@ -32,7 +32,9 @@ - Implicit conversions for `const` behave correctly now, meaning that code like `const SOMECONST = 0.int; procThatTakesInt32(SOMECONST)` will be illegal now. Simply write `const SOMECONST = 0` instead. - +- The `{.dynlib.}` pragma is now required for exporting symbols when making + shared objects on POSIX and macOS, which make it consistent with the behavior + on Windows. ## Library additions diff --git a/doc/manual.rst b/doc/manual.rst index 2f5673684..b31458fc4 100644 --- a/doc/manual.rst +++ b/doc/manual.rst @@ -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. |