This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap-core".

The branch, master has been updated
       via  1f969fe10cad0ace8fa35ca2734e348971cba72d (commit)
      from  99be8d70460b9ecd823fc27051a60ba105abd2cf (commit)


Summary of changes:
 snap-core.cabal                 |    9 +++++++--
 src/Snap/Internal/Http/Types.hs |    6 +++---
 src/Snap/Iteratee.hs            |    6 +++---
 test/snap-core-testsuite.cabal  |    9 +++++++--
 4 files changed, 20 insertions(+), 10 deletions(-)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1f969fe10cad0ace8fa35ca2734e348971cba72d
Author: Jacob Stanley <[email protected]>
Date:   Fri May 28 22:54:13 2010 +0800

    Portable version of snap-core can be built on Linux/Mac OS
    
    Changed cpp-options to use PORTABLE instead of WIN32
    - If the flag portable is set then PORTABLE is used
    - If the OS is Windows then PORTABLE is used

diff --git a/snap-core.cabal b/snap-core.cabal
index ec84598..21915be 100644
--- a/snap-core.cabal
+++ b/snap-core.cabal
@@ -100,6 +100,11 @@ Flag testsuite
                be evaluated but not printed.
   Default: False
 
+Flag portable
+  Description: Compile in cross-platform mode. No platform-specific code or
+               optimizations such as C routines will be used.
+  Default: False
+
 Library
   hs-source-dirs: src
 
@@ -109,8 +114,8 @@ Library
   if flag(testsuite)
     cpp-options: -DDEBUG_TEST
 
-  if os(windows)
-    cpp-options: -DWIN32
+  if flag(portable) || os(windows)
+    cpp-options: -DPORTABLE
   else
     c-sources: cbits/timefuncs.c
     include-dirs: cbits
diff --git a/src/Snap/Internal/Http/Types.hs b/src/Snap/Internal/Http/Types.hs
index 72a36a5..6b2ba21 100644
--- a/src/Snap/Internal/Http/Types.hs
+++ b/src/Snap/Internal/Http/Types.hs
@@ -43,7 +43,7 @@ import           Prelude hiding (take)
 import           System.Locale (defaultTimeLocale)
 
 
-#ifdef WIN32
+#ifdef PORTABLE
 import           Data.Time.LocalTime
 import           Data.Time.Clock.POSIX
 #else
@@ -55,7 +55,7 @@ import           Data.CIByteString
 import qualified Snap.Iteratee as I
 
 
-#ifndef WIN32
+#ifndef PORTABLE
 
 ------------------------------------------------------------------------------
 -- foreign imports from cbits
@@ -525,7 +525,7 @@ formatLogTime :: CTime -> IO ByteString
 -- | Converts an HTTP timestamp into a 'CTime'.
 parseHttpTime :: ByteString -> IO CTime
 
-#ifdef WIN32
+#ifdef PORTABLE
 
 formatHttpTime = return . format . toUTCTime
   where
diff --git a/src/Snap/Iteratee.hs b/src/Snap/Iteratee.hs
index 0f07bd6..d43d2bc 100644
--- a/src/Snap/Iteratee.hs
+++ b/src/Snap/Iteratee.hs
@@ -49,7 +49,7 @@ import qualified Data.ByteString.Unsafe as S
 import qualified Data.ByteString.Lazy as L
 import           Data.IORef
 import           Data.Iteratee
-#ifdef WIN32
+#ifdef PORTABLE
 import           Data.Iteratee.IO (enumHandle)
 #endif
 import qualified Data.Iteratee.Base.StreamChunk as SC
@@ -59,7 +59,7 @@ import           Foreign
 import           Prelude hiding (catch,drop)
 import qualified Data.DList as D
 
-#ifdef WIN32
+#ifdef PORTABLE
 import           Control.Monad.Trans (liftIO)
 import           System.IO
 #else
@@ -363,7 +363,7 @@ takeNoMoreThan n' iter =
 ------------------------------------------------------------------------------
 enumFile :: FilePath -> Iteratee IO a -> IO (Iteratee IO a)
 
-#ifdef WIN32
+#ifdef PORTABLE
 
 enumFile fp iter = do
     h  <- liftIO $ openBinaryFile fp ReadMode
diff --git a/test/snap-core-testsuite.cabal b/test/snap-core-testsuite.cabal
index eee6855..33727d5 100644
--- a/test/snap-core-testsuite.cabal
+++ b/test/snap-core-testsuite.cabal
@@ -12,6 +12,11 @@ Flag testsuite
                be evaluated but not printed.
   Default: False
 
+Flag portable
+  Description: Compile in cross-platform mode. No platform-specific code or
+               optimizations such as C routines will be used.
+  Default: False
+
 Executable testsuite
   hs-source-dirs:  ../src suite
   main-is:         TestSuite.hs
@@ -22,8 +27,8 @@ Executable testsuite
   if flag(testsuite)
     cpp-options: -DDEBUG_TEST
 
-  if os(windows)
-    cpp-options: -DWIN32
+  if flag(portable) || os(windows)
+    cpp-options: -DPORTABLE
   else
     c-sources: ../cbits/timefuncs.c
     include-dirs: ../cbits
-----------------------------------------------------------------------


hooks/post-receive
-- 
snap-core
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to