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
1.234500
\ No newline at end of file
0.8414709848078965
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment