Skip to content

Commit

Permalink
handle external pointers directly
Browse files Browse the repository at this point in the history
  • Loading branch information
duncantl committed Sep 17, 2017
1 parent 6555797 commit ca0acf7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/ffi.R
Expand Up @@ -14,13 +14,13 @@
function(fun, args, .ee, cif = genCIF(fun), .all = FALSE, ...)
{
if(is(fun, "Function"))
funptr = getPointerToFunction(fun, .ee)
else if(is(fun, "externalptr"))
funptr = getPointerToFunction(fun, .ee)@ref
else if(typeof(fun) == "externalptr") # is(fun, "externalptr"))
funptr = fun
else
stop("I'm confused! I need an LLVM Function object or an externalptr.")

callCIF(cif, funptr@ref, .args = args, ..., returnInputs = .all)
callCIF(cif, funptr, .args = args, ..., returnInputs = .all)
}


Expand Down

0 comments on commit ca0acf7

Please sign in to comment.