diff options
author | Reid Barton <rwbarton@gmail.com> | 2015-04-09 11:31:20 -0400 |
---|---|---|
committer | Reid Barton <rwbarton@gmail.com> | 2015-04-09 11:31:20 -0400 |
commit | f536d89603bb49dea192b47f54416dc88da980af (patch) | |
tree | 5bb14ea4821d3f0c8b241ab38cdbaf9125b36817 /libraries | |
parent | 6b96eeb72a17e35c59830952732170d29d99a598 (diff) | |
download | haskell-f536d89603bb49dea192b47f54416dc88da980af.tar.gz |
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: https://phabricator.haskell.org/D826
GHC Trac Issues: #10274
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/base/System/IO.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/base/System/IO.hs b/libraries/base/System/IO.hs index 52931fd189..7b1355273f 100644 --- a/libraries/base/System/IO.hs +++ b/libraries/base/System/IO.hs @@ -1,5 +1,5 @@ {-# 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 |