Commit 25ce026b authored by simonmar's avatar simonmar

[project @ 2004-10-12 08:22:09 by simonmar]

Don't use printf in this test, which is a variable-argument function and
hence unsupported by the FFI.
parent fead666f
-- !!! Test passing doubles to a ccall
import Foreign
import Foreign.C
foreign import ccall unsafe
printf :: CString -> Double -> IO CInt
foreign import ccall unsafe "math.h sin"
c_sin :: CDouble -> IO CDouble
main = withCString "%f" $ \s -> printf s 1.2345
main = c_sin 1.0 >>= print
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment