aboutsummaryrefslogtreecommitdiffhomepage
path: root/System
diff options
context:
space:
mode:
authorGravatar Herbert Valerio Riedel <hvr@gnu.org>2016-01-31 00:15:23 +0100
committerGravatar Herbert Valerio Riedel <hvr@gnu.org>2016-01-31 00:19:53 +0100
commit3e32e3912254b5b13ce27715cbd369e5e4b33241 (patch)
treeec0e4736fbe4d82eca2f9aa050cd08594f289028 /System
parent364604035c60fe5c21cda2e2f37027ebadc81ebd (diff)
Replace `__hscore_mk{dtemp,stemp,stemps}` wrappers with CApiFFI
Diffstat (limited to 'System')
-rw-r--r--System/Posix/Temp.hsc7
-rw-r--r--System/Posix/Temp/ByteString.hsc7
2 files changed, 8 insertions, 6 deletions
diff --git a/System/Posix/Temp.hsc b/System/Posix/Temp.hsc
index 473364c..3984144 100644
--- a/System/Posix/Temp.hsc
+++ b/System/Posix/Temp.hsc
@@ -1,3 +1,4 @@
+{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
@@ -33,7 +34,7 @@ import System.Posix.IO
import System.Posix.Types
import System.Posix.Internals (withFilePath, peekFilePath)
-foreign import ccall unsafe "HsUnix.h __hscore_mkstemp"
+foreign import capi unsafe "HsUnix.h mkstemp"
c_mkstemp :: CString -> IO CInt
-- | Make a unique filename and open it for reading\/writing. The returned
@@ -53,7 +54,7 @@ mkstemp template' = do
return (name, h)
#if HAVE_MKSTEMPS
-foreign import ccall unsafe "HsUnix.h __hscore_mkstemps"
+foreign import capi unsafe "HsUnix.h mkstemps"
c_mkstemps :: CString -> CInt -> IO CInt
#endif
@@ -81,7 +82,7 @@ mkstemps = error "System.Posix.Temp.mkstemps: not available on this platform"
#endif
#if HAVE_MKDTEMP
-foreign import ccall unsafe "HsUnix.h __hscore_mkdtemp"
+foreign import capi unsafe "HsUnix.h mkdtemp"
c_mkdtemp :: CString -> IO CString
#endif
diff --git a/System/Posix/Temp/ByteString.hsc b/System/Posix/Temp/ByteString.hsc
index 67442fc..0e30c6f 100644
--- a/System/Posix/Temp/ByteString.hsc
+++ b/System/Posix/Temp/ByteString.hsc
@@ -1,3 +1,4 @@
+{-# LANGUAGE CApiFFI #-}
#if __GLASGOW_HASKELL__ >= 709
{-# LANGUAGE Safe #-}
#else
@@ -38,7 +39,7 @@ import System.Posix.Directory (createDirectory)
import System.Posix.IO
import System.Posix.Types
-foreign import ccall unsafe "HsUnix.h __hscore_mkstemp"
+foreign import capi unsafe "HsUnix.h mkstemp"
c_mkstemp :: CString -> IO CInt
-- | Make a unique filename and open it for reading\/writing. The returned
@@ -58,7 +59,7 @@ mkstemp template' = do
return (name, h)
#if HAVE_MKSTEMPS
-foreign import ccall unsafe "HsUnix.h __hscore_mkstemps"
+foreign import capi unsafe "HsUnix.h mkstemps"
c_mkstemps :: CString -> CInt -> IO CInt
#endif
@@ -82,7 +83,7 @@ mkstemps = error "System.Posix.Temp.mkstemps: not available on this platform"
#endif
#if HAVE_MKDTEMP
-foreign import ccall unsafe "HsUnix.h __hscore_mkdtemp"
+foreign import capi unsafe "HsUnix.h mkdtemp"
c_mkdtemp :: CString -> IO CString
#endif