update manual (#20325)
1. remove two redundant `.`; 1. add information on format string for `importc` just as `exportc`
This commit is contained in:
parent
1699ba1c93
commit
89e6540fd3
1 changed files with 4 additions and 2 deletions
|
|
@ -7893,9 +7893,9 @@ will generate this code:
|
||||||
`cppNonPod` pragma
|
`cppNonPod` pragma
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
The `.cppNonPod` pragma should be used for non-POD `importcpp` types so that they
|
The `cppNonPod` pragma should be used for non-POD `importcpp` types so that they
|
||||||
work properly (in particular regarding constructor and destructor) for
|
work properly (in particular regarding constructor and destructor) for
|
||||||
`.threadvar` variables. This requires `--tlsEmulation:off`:option:.
|
`threadvar` variables. This requires `--tlsEmulation:off`:option:.
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
type Foo {.cppNonPod, importcpp, header: "funs.h".} = object
|
type Foo {.cppNonPod, importcpp, header: "funs.h".} = object
|
||||||
|
|
@ -8127,6 +8127,8 @@ is not set to C, other pragmas are available:
|
||||||
* `importobjc <manual.html#implementation-specific-pragmas-importobjc-pragma>`_
|
* `importobjc <manual.html#implementation-specific-pragmas-importobjc-pragma>`_
|
||||||
* `importjs <manual.html#implementation-specific-pragmas-importjs-pragma>`_
|
* `importjs <manual.html#implementation-specific-pragmas-importjs-pragma>`_
|
||||||
|
|
||||||
|
The string literal passed to `importc` can be a format string:
|
||||||
|
|
||||||
```Nim
|
```Nim
|
||||||
proc p(s: cstring) {.importc: "prefix$1".}
|
proc p(s: cstring) {.importc: "prefix$1".}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue