diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.6
+
+* fix compilation on architecture where endianness is not a compile time define related
+  to their cabal arch().
+
 ## 0.5
 
 * Add Base32 support (Nicolas Di Prima)
diff --git a/Data/Memory/Endian.hs b/Data/Memory/Endian.hs
--- a/Data/Memory/Endian.hs
+++ b/Data/Memory/Endian.hs
@@ -19,7 +19,10 @@
 import Data.Word (Word16, Word32, Word64)
 import Foreign.Storable
 #if !defined(ARCH_IS_LITTLE_ENDIAN) && !defined(ARCH_IS_BIG_ENDIAN)
+import Data.Word (Word8)
 import Data.Memory.Internal.Compat (unsafeDoIO)
+import Foreign.Marshal.Alloc
+import Foreign.Ptr
 #endif
 
 import Data.Memory.Internal.Compat (byteSwap64, byteSwap32, byteSwap16)
diff --git a/memory.cabal b/memory.cabal
--- a/memory.cabal
+++ b/memory.cabal
@@ -1,5 +1,5 @@
 Name:                memory
-Version:             0.5
+Version:             0.6
 Synopsis:            memory and related abtraction stuff
 Description:
     Chunk of memory, polymorphic byte array management and manipulation
