[commit: ghc] master: Import rand using capi (f536d89)
git at git.haskell.org
git at git.haskell.org
Thu Apr 9 15:31:26 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/f536d89603bb49dea192b47f54416dc88da980af/ghc
>---------------------------------------------------------------
commit f536d89603bb49dea192b47f54416dc88da980af
Author: Reid Barton <rwbarton at gmail.com>
Date: Thu Apr 9 11:31:20 2015 -0400
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
>---------------------------------------------------------------
f536d89603bb49dea192b47f54416dc88da980af
libraries/base/System/IO.hs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libraries/base/System/IO.hs b/libraries/base/System/IO.hs
index 52931fd..7b13552 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
More information about the ghc-commits
mailing list