From e39510aa26b8cfc43ff66a7a25fa7b43773c681c Mon Sep 17 00:00:00 2001
From: David Terei <davidterei@gmail.com>
Date: Tue, 9 Aug 2011 10:50:03 -0700
Subject: [PATCH] Fix conditional pragma to work with 6.12

---
 System/Posix.hs                       | 3 +++
 System/Posix/Directory.hsc            | 4 ++--
 System/Posix/DynamicLinker/Module.hsc | 2 +-
 System/Posix/DynamicLinker/Prim.hsc   | 2 +-
 System/Posix/Env.hsc                  | 2 +-
 System/Posix/Files.hsc                | 4 ++--
 System/Posix/IO.hsc                   | 6 +++---
 System/Posix/Process.hsc              | 2 +-
 System/Posix/Resource.hsc             | 4 ++--
 System/Posix/Semaphore.hsc            | 2 +-
 System/Posix/SharedMem.hsc            | 4 ++--
 System/Posix/Signals.hsc              | 4 ++--
 System/Posix/Signals/Exts.hsc         | 2 +-
 System/Posix/Temp.hsc                 | 2 +-
 System/Posix/Terminal.hsc             | 3 +++
 System/Posix/Time.hsc                 | 2 +-
 System/Posix/Unistd.hsc               | 4 ++--
 System/Posix/User.hsc                 | 2 +-
 18 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/System/Posix.hs b/System/Posix.hs
index 40fb85d..ad51792 100644
--- a/System/Posix.hs
+++ b/System/Posix.hs
@@ -1,3 +1,6 @@
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix
diff --git a/System/Posix/Directory.hsc b/System/Posix/Directory.hsc
index 47fd91f..48e7390 100644
--- a/System/Posix/Directory.hsc
+++ b/System/Posix/Directory.hsc
@@ -1,8 +1,8 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
-{-# OPTIONS_GHC -fno-warn-unused-imports #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Files
diff --git a/System/Posix/DynamicLinker/Module.hsc b/System/Posix/DynamicLinker/Module.hsc
index 15d19df..c678fed 100644
--- a/System/Posix/DynamicLinker/Module.hsc
+++ b/System/Posix/DynamicLinker/Module.hsc
@@ -1,7 +1,7 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.DynamicLinker.Module
diff --git a/System/Posix/DynamicLinker/Prim.hsc b/System/Posix/DynamicLinker/Prim.hsc
index d285ff6..2b11261 100644
--- a/System/Posix/DynamicLinker/Prim.hsc
+++ b/System/Posix/DynamicLinker/Prim.hsc
@@ -1,7 +1,7 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.DynamicLinker.Prim
diff --git a/System/Posix/Env.hsc b/System/Posix/Env.hsc
index ba24c29..374d0a8 100644
--- a/System/Posix/Env.hsc
+++ b/System/Posix/Env.hsc
@@ -1,7 +1,7 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Env
diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc
index 0831bc4..5606388 100644
--- a/System/Posix/Files.hsc
+++ b/System/Posix/Files.hsc
@@ -1,8 +1,8 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
-{-# OPTIONS_GHC -fno-warn-unused-imports #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Files
diff --git a/System/Posix/IO.hsc b/System/Posix/IO.hsc
index 31ee04b..c1a2d0c 100644
--- a/System/Posix/IO.hsc
+++ b/System/Posix/IO.hsc
@@ -1,9 +1,9 @@
-#if __GLASGOW_HASKELL__ >= 701
-{-# LANGUAGE Trustworthy #-}
-#endif
 {-# LANGUAGE ForeignFunctionInterface #-}
 {-# OPTIONS_GHC -fno-warn-unused-imports #-}
 {-# OPTIONS_GHC -XRecordWildCards #-}
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Trustworthy #-}
+#endif
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.IO
diff --git a/System/Posix/Process.hsc b/System/Posix/Process.hsc
index 87277ae..99c3962 100644
--- a/System/Posix/Process.hsc
+++ b/System/Posix/Process.hsc
@@ -1,7 +1,7 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Process
diff --git a/System/Posix/Resource.hsc b/System/Posix/Resource.hsc
index 84aa009..6651998 100644
--- a/System/Posix/Resource.hsc
+++ b/System/Posix/Resource.hsc
@@ -1,8 +1,8 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# OPTIONS_GHC -w #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
-{-# OPTIONS_GHC -w #-}
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
 -- any warnings in the module. See
diff --git a/System/Posix/Semaphore.hsc b/System/Posix/Semaphore.hsc
index 900f7da..9ff39f4 100644
--- a/System/Posix/Semaphore.hsc
+++ b/System/Posix/Semaphore.hsc
@@ -1,7 +1,7 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Semaphore
diff --git a/System/Posix/SharedMem.hsc b/System/Posix/SharedMem.hsc
index 81febd3..8e51568 100644
--- a/System/Posix/SharedMem.hsc
+++ b/System/Posix/SharedMem.hsc
@@ -1,8 +1,8 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
-{-# OPTIONS_GHC -fno-warn-unused-imports #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.SharedMem
diff --git a/System/Posix/Signals.hsc b/System/Posix/Signals.hsc
index 13e1e05..a284d48 100644
--- a/System/Posix/Signals.hsc
+++ b/System/Posix/Signals.hsc
@@ -1,8 +1,8 @@
+{-# LANGUAGE DeriveDataTypeable,PatternGuards #-}
+{-# OPTIONS_GHC -fno-cse #-} -- global variables
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE DeriveDataTypeable,PatternGuards #-}
-{-# OPTIONS_GHC -fno-cse #-} -- global variables
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Signals
diff --git a/System/Posix/Signals/Exts.hsc b/System/Posix/Signals/Exts.hsc
index 1ff4049..4b466f1 100644
--- a/System/Posix/Signals/Exts.hsc
+++ b/System/Posix/Signals/Exts.hsc
@@ -1,7 +1,7 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Signals.Exts
diff --git a/System/Posix/Temp.hsc b/System/Posix/Temp.hsc
index b6af83e..a55d5fe 100644
--- a/System/Posix/Temp.hsc
+++ b/System/Posix/Temp.hsc
@@ -1,7 +1,7 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Temp
diff --git a/System/Posix/Terminal.hsc b/System/Posix/Terminal.hsc
index 54f1589..3685589 100644
--- a/System/Posix/Terminal.hsc
+++ b/System/Posix/Terminal.hsc
@@ -1,5 +1,8 @@
 {-# LANGUAGE ForeignFunctionInterface #-}
 {-# OPTIONS_GHC -fno-warn-unused-imports #-}
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Trustworthy #-}
+#endif
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Terminal
diff --git a/System/Posix/Time.hsc b/System/Posix/Time.hsc
index 9de3937..641b955 100644
--- a/System/Posix/Time.hsc
+++ b/System/Posix/Time.hsc
@@ -1,7 +1,7 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Time
diff --git a/System/Posix/Unistd.hsc b/System/Posix/Unistd.hsc
index 8fbb525..7312dae 100644
--- a/System/Posix/Unistd.hsc
+++ b/System/Posix/Unistd.hsc
@@ -1,8 +1,8 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-binds #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
-{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-binds #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.Unistd
diff --git a/System/Posix/User.hsc b/System/Posix/User.hsc
index f1d4fc4..71d2ea0 100644
--- a/System/Posix/User.hsc
+++ b/System/Posix/User.hsc
@@ -1,7 +1,7 @@
+{-# LANGUAGE ForeignFunctionInterface #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Trustworthy #-}
 #endif
-{-# LANGUAGE ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.Posix.User
-- 
GitLab