Skip to content

Instantly share code, notes, and snippets.

@guolas
Created August 8, 2013 21:29
Show Gist options
  • Save guolas/6188946 to your computer and use it in GitHub Desktop.
Save guolas/6188946 to your computer and use it in GitHub Desktop.
ccall problem recognizing tuple types
f(x) = typeof(x)==ASCIIString?Ptr{Uint8}:typeof(x)
args = ("%.1f\n", 2.3)
args_type = map(f, args)
return_value = ccall( (:printf, "libc"), Int32, (Ptr{Uint8}, Float64), args[1], args[2])
println(isa(args_type, typeof((Ptr{Uint8}, Float64))))
return_value = ccall( (:printf, "libc"), Int32, args_type, args[1], args[2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment