note on 64-bit ints in ccall/cwrap; #2823

This commit is contained in:
Alon Zakai 2014-09-28 20:47:29 -07:00
Родитель 2f57b4b2ce
Коммит 98018a8e79
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -52,6 +52,7 @@ Calling compiled C functions from JavaScript
:param ident: The name of the C function to be called.
:param returnType: The return type of the function. This can be ``"number"``, ``"string"`` or ``"array"``, which correspond to the appropriate JavaScript types (use ``"number"`` for any C pointer, and ``"array"`` for JavaScript arrays and typed arrays; note that arrays are 8-bit), or for a void function it can be ``null`` (note: the JavaScript ``null`` value, not a string containing the word "null").
.. note:: 64-bit integers become two 32-bit parameters, for the low and high bits (since 64-bit integers cannot be represented in JavaScript numbers).
:param argTypes: An array of the types of arguments for the function (if there are no arguments, this can be omitted). Types are as in ``returnType``, except that ``array`` is not supported as there is no way for us to know the length of the array).
:param args: An array of the arguments to the function, as native JavaScript values (as in ``returnType``). Note that string arguments will be stored on the stack (the JavaScript string will become a C string on the stack).
:returns: The result of the function call as a native JavaScript value (as in ``returnType``).