Hyperlinks together importc like pragmas.

This commit is contained in:
Grzegorz Adam Hankiewicz 2014-06-21 19:35:40 +02:00
commit 9ed984201d
2 changed files with 14 additions and 10 deletions

View file

@ -5488,7 +5488,10 @@ spelled*:
proc printf(formatstr: cstring) {.header: "<stdio.h>", importc: "printf", varargs.} proc printf(formatstr: cstring) {.header: "<stdio.h>", importc: "printf", varargs.}
Note that this pragma is somewhat of a misnomer: Other backends will provide Note that this pragma is somewhat of a misnomer: Other backends will provide
the same feature under the same name. the same feature under the same name. Also, if you are interfacing with C++
you can use the `ImportCpp pragma <nimrodc.html#importcpp-pragma>`_ and
interfacing with Objective-C the `ImportObjC pragma
<nimrodc.html#importobjc-pragma>`_.
Exportc pragma Exportc pragma

View file

@ -384,9 +384,10 @@ Example:
ImportCpp pragma ImportCpp pragma
---------------- ----------------
The ``importcpp`` pragma can be used to import `C++`:idx: methods. The Similar to the `importc pragma for C <manual.html#importc-pragma>`_, the
generated code then uses the C++ method calling syntax: ``obj->method(arg)``. ``importcpp`` pragma can be used to import `C++`:idx: methods. The generated
In addition with the ``header`` and ``emit`` pragmas this allows *sloppy* code then uses the C++ method calling syntax: ``obj->method(arg)``. In
addition with the ``header`` and ``emit`` pragmas this allows *sloppy*
interfacing with libraries written in C++: interfacing with libraries written in C++:
.. code-block:: Nimrod .. code-block:: Nimrod
@ -422,11 +423,11 @@ emits C++ code.
ImportObjC pragma ImportObjC pragma
----------------- -----------------
The ``importobjc`` pragma can be used to import `Objective C`:idx: methods. Similar to the `importc pragma for C <manual.html#importc-pragma>`_, the
The generated code then uses the Objective C method calling ``importobjc`` pragma can be used to import `Objective C`:idx: methods. The
syntax: ``[obj method param1: arg]``. generated code then uses the Objective C method calling syntax: ``[obj method
In addition with the ``header`` and ``emit`` pragmas this allows *sloppy* param1: arg]``. In addition with the ``header`` and ``emit`` pragmas this
interfacing with libraries written in Objective C: allows *sloppy* interfacing with libraries written in Objective C:
.. code-block:: Nimrod .. code-block:: Nimrod
# horrible example of how to interface with GNUStep ... # horrible example of how to interface with GNUStep ...