mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 05:20:31 +00:00
* Revert "Make config processing order test more robust" This reverts commitcf714c129f. * enable tmath tests * fix #8412 * Revert "enable tmath tests" This reverts commit293b63f57e. * add tests * fix
This commit is contained in:
@@ -2394,16 +2394,22 @@ when notJSnotNims:
|
||||
proc rawProc*[T: proc](x: T): pointer {.noSideEffect, inline.} =
|
||||
## Retrieves the raw proc pointer of the closure `x`. This is
|
||||
## useful for interfacing closures with C.
|
||||
{.emit: """
|
||||
`result` = `x`.ClP_0;
|
||||
""".}
|
||||
when T is "closure":
|
||||
{.emit: """
|
||||
`result` = `x`.ClP_0;
|
||||
""".}
|
||||
else:
|
||||
{.error: "Only closure function and iterator are allowed!".}
|
||||
|
||||
proc rawEnv*[T: proc](x: T): pointer {.noSideEffect, inline.} =
|
||||
## Retrieves the raw environment pointer of the closure `x`. This is
|
||||
## useful for interfacing closures with C.
|
||||
{.emit: """
|
||||
`result` = `x`.ClE_0;
|
||||
""".}
|
||||
when T is "closure":
|
||||
{.emit: """
|
||||
`result` = `x`.ClE_0;
|
||||
""".}
|
||||
else:
|
||||
{.error: "Only closure function and iterator are allowed!".}
|
||||
|
||||
proc finished*[T: proc](x: T): bool {.noSideEffect, inline.} =
|
||||
## can be used to determine if a first class iterator has finished.
|
||||
|
||||
Reference in New Issue
Block a user