Re: [PATCH] (haskeline) Include termios.h on android

2013-02-17 Thread Ian Lynagh
On Sun, Feb 17, 2013 at 05:01:45PM +0100, Nathan Hüsken wrote:
> On 02/17/2013 01:42 PM, Ian Lynagh wrote:
> >
> >>-#ifdef USE_TERMIOS_H
> >>+#if defined(USE_TERMIOS_H) || defined(__ANDROID__)
> >It looks like this would be better handled by defining USE_TERMIOS_H in
> >the .cabal file if the os is android.
> >
> I agree, but I was unable to detect in tharget os in cabal when
> cross compiling.

Ah, that should be fixed then. It shouldn't be too hard: the
"ghc --info" output already includes e.g.
 ,("target os","OSLinux")
and I'm pretty sure that Cabal already parses the --info output, so it
should just be a case of using that value when evaluating the
os(android) conditional.

Ah, hmm, except OSLinux is a constructor of a type that is in the ghc
package. Cabal has slightly different types in Distribution.System.
Should we make a shared type, possibly in a new 'platform' package?


Thanks
Ian


___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs


Re: [PATCH] (haskeline) Include termios.h on android

2013-02-17 Thread Nathan Hüsken

On 02/17/2013 01:42 PM, Ian Lynagh wrote:

Hi Nathan,

On Fri, Jan 25, 2013 at 09:45:47AM +0100, Nathan Hüsken wrote:

This patch is for libraries/haskeline.

Thanks for the patch, although note that haskeline is maintained by
 Judah Jacobson 
and has a trac here:
 http://trac.haskell.org/haskeline


-#ifdef USE_TERMIOS_H
+#if defined(USE_TERMIOS_H) || defined(__ANDROID__)

It looks like this would be better handled by defining USE_TERMIOS_H in
the .cabal file if the os is android.

I agree, but I was unable to detect in tharget os in cabal when cross 
compiling.


___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs


Re: [PATCH] (haskeline) Include termios.h on android

2013-02-17 Thread Ian Lynagh

Hi Nathan,

On Fri, Jan 25, 2013 at 09:45:47AM +0100, Nathan Hüsken wrote:
> 
> This patch is for libraries/haskeline.

Thanks for the patch, although note that haskeline is maintained by
Judah Jacobson 
and has a trac here:
http://trac.haskell.org/haskeline

> -#ifdef USE_TERMIOS_H
> +#if defined(USE_TERMIOS_H) || defined(__ANDROID__)

It looks like this would be better handled by defining USE_TERMIOS_H in
the .cabal file if the os is android.


Thanks
Ian


___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs


[PATCH] (haskeline) Include termios.h on android

2013-01-25 Thread Nathan Hüsken
Hey,

This patch is for libraries/haskeline.
On android, winsize is defined in termios.h and therefor termios.h must
be included.
>From a081ad57f161f056f7e4c0bd8907de8bb24efa04 Mon Sep 17 00:00:00 2001
From: Nathan 
Date: Thu, 24 Jan 2013 15:30:15 +0100
Subject: [PATCH] Include termios.h on android because winsize is defined in
 it

---
 System/Console/Haskeline/Backend/Posix.hsc |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/System/Console/Haskeline/Backend/Posix.hsc b/System/Console/Haskeline/Backend/Posix.hsc
index db9c66e..74bba7a 100644
--- a/System/Console/Haskeline/Backend/Posix.hsc
+++ b/System/Console/Haskeline/Backend/Posix.hsc
@@ -48,7 +48,7 @@ import GHC.IOBase(haFD,FD)
 import GHC.Handle (withHandle_)
 #endif
 
-#ifdef USE_TERMIOS_H
+#if defined(USE_TERMIOS_H) || defined(__ANDROID__)
 #include 
 #endif
 #include 
@@ -64,7 +64,6 @@ ehOut = eH . hOut
 
 ---
 -- Window size
-
 foreign import ccall ioctl :: FD -> CULong -> Ptr a -> IO CInt
 
 posixLayouts :: Handles -> [IO (Maybe Layout)]
-- 
1.7.10.4

___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs