diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
 # Revision history for derive-storable
 
+## 0.1.1.1  -- 2017-10-05
+
+* Fixed a bug with POSIX types enabled on non POSIX systems.
+
 ## 0.1.1.0  -- 2017-07-19
 
 * Bumped to GHC 8.2.*
diff --git a/derive-storable.cabal b/derive-storable.cabal
--- a/derive-storable.cabal
+++ b/derive-storable.cabal
@@ -1,6 +1,6 @@
 name:                derive-storable
 
-version:             0.1.1.0
+version:             0.1.1.1
 synopsis:            Derive Storable instances with GHC.Generics.           
 
 description:         Derive Storable instances with GHC.Generics. The derived Storable instances have the same alignment as C structs.
diff --git a/src/Foreign/Storable/Generic/Instances.hs b/src/Foreign/Storable/Generic/Instances.hs
--- a/src/Foreign/Storable/Generic/Instances.hs
+++ b/src/Foreign/Storable/Generic/Instances.hs
@@ -9,7 +9,9 @@
 
 -}
 
+
 {-# LANGUAGE CPP #-}
+#include "HsBaseConfig.h"
 module Foreign.Storable.Generic.Instances () where
 
 import Data.Int
@@ -87,19 +89,45 @@
 
 -- Posix
 MakeGStorable(Fd)
+#if defined(HTYPE_RLIM_T)
 MakeGStorable(CRLim)
+#endif
+#if defined(HTYPE_TCFLAG_T)
 MakeGStorable(CTcflag)
+#endif
+#if defined(HTYPE_SPEED_T)
 MakeGStorable(CSpeed)
+#endif
+#if defined(HTYPE_CC_T)
 MakeGStorable(CCc)
+#endif
+#if defined(HTYPE_UID_T)
 MakeGStorable(CUid)
+#endif
+#if defined(HTYPE_NLINK_T)
 MakeGStorable(CNlink)
+#endif
+#if defined(HTYPE_GID_T)
 MakeGStorable(CGid)
+#endif
+#if defined(HTYPE_SSIZE_T)
 MakeGStorable(CSsize)
+#endif
+#if defined(HTYPE_PID_T)
 MakeGStorable(CPid)
+#endif
+#if defined(HTYPE_OFF_T)
 MakeGStorable(COff)
+#endif
+#if defined(HTYPE_MODE_T)
 MakeGStorable(CMode)
+#endif
+#if defined(HTYPE_INO_T)
 MakeGStorable(CIno)
+#endif
+#if defined(HTYPE_DEV_T)
 MakeGStorable(CDev)
+#endif
  
 
 
