diff --git a/System/Posix/SharedMem.hsc b/System/Posix/SharedMem.hsc
index 1d7a80ac1cb737110b56f6f55cf7accd32811d93..c85e4b7f74a9e29136c68b8a673919ea1aa576fd 100644
--- a/System/Posix/SharedMem.hsc
+++ b/System/Posix/SharedMem.hsc
@@ -19,12 +19,12 @@ module System.Posix.SharedMem
     (ShmOpenFlags(..), shmOpen, shmUnlink)
     where
 
+#include "HsUnix.h"
+
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <fcntl.h>
 
-#include "HsUnix.h"
-
 import System.Posix.Types
 #if defined(HAVE_SHM_OPEN) || defined(HAVE_SHM_UNLINK)
 import Foreign.C