[PATCH] Wrap mkfifo, tcsetattr and tcgetattr on android because they are inline and cause linker failer
Nathan
nathan.huesken at posteo.de
Tue Jan 29 23:25:38 CET 2013
---
System/Posix/Internals.hs | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/System/Posix/Internals.hs b/System/Posix/Internals.hs
index 1633a3e..d5bc0c9 100644
--- a/System/Posix/Internals.hs
+++ b/System/Posix/Internals.hs
@@ -488,8 +488,13 @@ foreign import ccall unsafe "HsBase.h fork"
foreign import ccall unsafe "HsBase.h link"
c_link :: CString -> CString -> IO CInt
+#ifndef linux_android_HOST_OS
foreign import ccall unsafe "HsBase.h mkfifo"
c_mkfifo :: CString -> CMode -> IO CInt
+#else
+foreign import capi unsafe "HsBase.h mkfifo"
+ c_mkfifo :: CString -> CMode -> IO CInt
+#endif
foreign import ccall unsafe "HsBase.h pipe"
c_pipe :: Ptr CInt -> IO CInt
@@ -503,11 +508,19 @@ foreign import capi unsafe "signal.h sigaddset"
foreign import capi unsafe "signal.h sigprocmask"
c_sigprocmask :: CInt -> Ptr CSigset -> Ptr CSigset -> IO CInt
+#ifndef linux_android_HOST_OS
foreign import ccall unsafe "HsBase.h tcgetattr"
c_tcgetattr :: CInt -> Ptr CTermios -> IO CInt
foreign import ccall unsafe "HsBase.h tcsetattr"
c_tcsetattr :: CInt -> CInt -> Ptr CTermios -> IO CInt
+#else
+foreign import capi unsafe "HsBase.h tcgetattr"
+ c_tcgetattr :: CInt -> Ptr CTermios -> IO CInt
+
+foreign import capi unsafe "HsBase.h tcsetattr"
+ c_tcsetattr :: CInt -> CInt -> Ptr CTermios -> IO CInt
+#endif
foreign import capi unsafe "HsBase.h utime"
c_utime :: CString -> Ptr CUtimbuf -> IO CInt
--
1.7.10.4
--------------060400070807020300080702--
More information about the ghc-devs
mailing list