[commit: base] data-proxy,master: Fix GHC.Enum on 32bit platforms; fixes #8072 (af77ef4)
Richard Eisenberg
eir at ghc.haskell.org
Tue Jul 23 16:04:18 CEST 2013
Repository : http://darcs.haskell.org/ghc.git/
On branches: data-proxy,master
http://hackage.haskell.org/trac/ghc/changeset/af77ef45d576fddb25acf28beb434ef431f430a0
>---------------------------------------------------------------
commit af77ef45d576fddb25acf28beb434ef431f430a0
Author: Ian Lynagh <ian at well-typed.com>
Date: Sun Jul 21 19:09:45 2013 +0100
Fix GHC.Enum on 32bit platforms; fixes #8072
Diagnosed by int-e.
MachDeps.h wasn't being included in Enum.lhs, and the old
WORD_SIZE_IN_BITS test didn't fail when WORD_SIZE_IN_BITS isn't
defined. Now we get an error instead.
>---------------------------------------------------------------
GHC/Enum.lhs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/GHC/Enum.lhs b/GHC/Enum.lhs
index 625214a..f2e0b5b 100644
--- a/GHC/Enum.lhs
+++ b/GHC/Enum.lhs
@@ -17,6 +17,8 @@
--
-----------------------------------------------------------------------------
+#include "MachDeps.h"
+
-- #hide
module GHC.Enum(
Bounded(..), Enum(..),
@@ -640,8 +642,10 @@ instance Bounded Word where
-- (fromInteger 0xffffffff :: Word).
#if WORD_SIZE_IN_BITS == 32
maxBound = W# (int2Word# 0xFFFFFFFF#)
-#else
+#elif WORD_SIZE_IN_BITS == 64
maxBound = W# (int2Word# 0xFFFFFFFFFFFFFFFF#)
+#else
+#error Unhandled value for WORD_SIZE_IN_BITS
#endif
\end{code}
More information about the ghc-commits
mailing list