Commit f536d896 authored by rwbarton's avatar rwbarton

Import rand using capi

Summary: Android has no rand symbol (it's a static inline function there).

Test Plan: ghc-android builds

Reviewers: trofi, austin, hvr

Reviewed By: hvr

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #10274
parent 6b96eeb7
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude #-}
{-# LANGUAGE CPP, NoImplicitPrelude, CApiFFI #-}
-- |
......@@ -509,7 +509,7 @@ openTempFile' loc tmp_dir template binary mode = findTempName
| otherwise = a ++ [pathSeparator] ++ b
-- int rand(void) from <stdlib.h>, limited by RAND_MAX (small value, 32768)
foreign import ccall "rand" c_rand :: IO CInt
foreign import capi "stdlib.h rand" c_rand :: IO CInt
-- build large digit-alike number
rand_string :: IO String
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