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-server".
The branch, master has been updated
via 3bc11b99856a762de3de19200f3a9d56e2d79e18 (commit)
from 78969b8a8bb7ad5240c63a495286587498340d3e (commit)
Summary of changes:
snap-server.cabal | 12 ++++++++----
src/Snap/Internal/Http/Server/Date.hs | 4 ++--
test/snap-server-testsuite.cabal | 13 +++++++++----
3 files changed, 19 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 3bc11b99856a762de3de19200f3a9d56e2d79e18
Author: Jacob Stanley <[email protected]>
Date: Fri May 28 23:33:08 2010 +0800
Portable version of snap-server 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-server.cabal b/snap-server.cabal
index fe17d49..1a1ef81 100644
--- a/snap-server.cabal
+++ b/snap-server.cabal
@@ -72,6 +72,11 @@ Flag libev
Description: Use libev?
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: dist/build/autogen, src
@@ -111,7 +116,9 @@ Library
unix-compat,
vector >= 0.6 && <0.7
- if !os(windows)
+ if flag(portable) || os(windows)
+ cpp-options: -DPORTABLE
+ else
build-depends: unix
if flag(libev)
@@ -130,9 +137,6 @@ Library
if os(darwin)
cpp-options: -DOSX
- if os(windows)
- cpp-options: -DWIN32
-
ghc-prof-options: -prof -auto-all
if impl(ghc >= 6.12.0)
diff --git a/src/Snap/Internal/Http/Server/Date.hs
b/src/Snap/Internal/Http/Server/Date.hs
index 2461265..6d9b371 100644
--- a/src/Snap/Internal/Http/Server/Date.hs
+++ b/src/Snap/Internal/Http/Server/Date.hs
@@ -14,7 +14,7 @@ import Data.IORef
import Foreign.C.Types
import System.IO.Unsafe
-#ifndef WIN32
+#ifndef PORTABLE
import System.Posix.Time
#else
import Data.Time.Clock.POSIX
@@ -60,7 +60,7 @@ dateState = unsafePerformIO $ do
return d
-#ifdef WIN32
+#ifdef PORTABLE
epochTime :: IO CTime
epochTime = do
t <- getPOSIXTime
diff --git a/test/snap-server-testsuite.cabal b/test/snap-server-testsuite.cabal
index b94928c..ed5241e 100644
--- a/test/snap-server-testsuite.cabal
+++ b/test/snap-server-testsuite.cabal
@@ -7,6 +7,11 @@ Flag libev
Description: Use libev?
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
@@ -55,8 +60,8 @@ Executable testsuite
other-modules: Snap.Internal.Http.Server.SimpleBackend
- if os(windows)
- cpp-options: -DWIN32
+ if flag(portable) || os(windows)
+ cpp-options: -DPORTABLE
ghc-options: -O2 -Wall -fhpc -fwarn-tabs -funbox-strict-fields -threaded
-fno-warn-unused-do-bind
@@ -114,8 +119,8 @@ Executable pongserver
if os(darwin)
cpp-options: -DOSX
- if os(windows)
- cpp-options: -DWIN32
+ if flag(portable) || os(windows)
+ cpp-options: -DPORTABLE
ghc-options: -Wall -O2 -fwarn-tabs -funbox-strict-fields -threaded
-fno-warn-unused-do-bind
-----------------------------------------------------------------------
hooks/post-receive
--
snap-server
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap