Skip to content

Instantly share code, notes, and snippets.

@pao
Forked from dcampbell24/gist:3470851
Created September 19, 2012 12:46
Show Gist options
  • Save pao/3749454 to your computer and use it in GitHub Desktop.
Save pao/3749454 to your computer and use it in GitHub Desktop.
julia ccall macro
macro ccallWrap(lib, fnSym, retType, argTypes)
args = [gensym() for i in 1:length(argTypes.args)]
fnArgs = [:($(args[i])::$(argTypes[i]))
for i in 1:length(argTypes)]
:(($fnSym)($fnArgs...) = ccall(dlsym($lib, $fnSym), $retType, $argTypes, $args...))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment