aboutsummaryrefslogtreecommitdiffhomepage
path: root/System
diff options
context:
space:
mode:
authorGravatar Herbert Valerio Riedel <hvr@gnu.org>2013-10-12 13:01:50 +0200
committerGravatar Herbert Valerio Riedel <hvr@gnu.org>2013-10-12 13:01:50 +0200
commit43de23c79db9e6e9a6de984b964cc9bdf74e50c2 (patch)
tree57179f113ca818097ab3c19fba59a6535ef34c11 /System
parent6944df0d5bd6899ff61811f23cd4c03d1f595db3 (diff)
Declare language extensions via `{-# LANGUAGE -#}`
Only language extensions not active when `-XHaskell2010` is enabled are declared, this way we can drop many redundant `{-# LANGUAGE ForeignFunctionInterface #-}` occurences. This commit also removes/replaces some `{-# OPTIONS_GHC -XRecordWildCards #-}` pragmas. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Diffstat (limited to 'System')
-rw-r--r--System/Posix.hs1
-rw-r--r--System/Posix/ByteString.hs1
-rw-r--r--System/Posix/Directory.hsc2
-rw-r--r--System/Posix/Directory/ByteString.hsc2
-rw-r--r--System/Posix/Directory/Common.hsc1
-rw-r--r--System/Posix/DynamicLinker/Module.hsc1
-rw-r--r--System/Posix/DynamicLinker/Module/ByteString.hsc1
-rw-r--r--System/Posix/DynamicLinker/Prim.hsc1
-rw-r--r--System/Posix/Env.hsc1
-rw-r--r--System/Posix/Env/ByteString.hsc1
-rw-r--r--System/Posix/Error.hs1
-rw-r--r--System/Posix/Files.hsc1
-rw-r--r--System/Posix/Files/Common.hsc1
-rw-r--r--System/Posix/IO.hsc2
-rw-r--r--System/Posix/IO/ByteString.hsc2
-rw-r--r--System/Posix/IO/Common.hsc3
-rw-r--r--System/Posix/Process.hsc1
-rw-r--r--System/Posix/Process/ByteString.hsc1
-rw-r--r--System/Posix/Process/Common.hsc2
-rw-r--r--System/Posix/Process/Internals.hs1
-rw-r--r--System/Posix/Resource.hsc1
-rw-r--r--System/Posix/Semaphore.hsc1
-rw-r--r--System/Posix/SharedMem.hsc1
-rw-r--r--System/Posix/Signals.hsc2
-rw-r--r--System/Posix/Signals/Exts.hsc1
-rw-r--r--System/Posix/Temp.hsc1
-rw-r--r--System/Posix/Temp/ByteString.hsc1
-rw-r--r--System/Posix/Terminal.hsc1
-rw-r--r--System/Posix/Terminal/ByteString.hsc1
-rw-r--r--System/Posix/Terminal/Common.hsc1
-rw-r--r--System/Posix/Time.hsc1
-rw-r--r--System/Posix/Unistd.hsc2
-rw-r--r--System/Posix/User.hsc5
33 files changed, 13 insertions, 33 deletions
diff --git a/System/Posix.hs b/System/Posix.hs
index 5c6a503..09bdde6 100644
--- a/System/Posix.hs
+++ b/System/Posix.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Safe #-}
#endif
diff --git a/System/Posix/ByteString.hs b/System/Posix/ByteString.hs
index a9999c9..793020c 100644
--- a/System/Posix/ByteString.hs
+++ b/System/Posix/ByteString.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Safe #-}
#endif
diff --git a/System/Posix/Directory.hsc b/System/Posix/Directory.hsc
index be5ad8a..d2f30de 100644
--- a/System/Posix/Directory.hsc
+++ b/System/Posix/Directory.hsc
@@ -1,4 +1,4 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE NondecreasingIndentation #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/Directory/ByteString.hsc b/System/Posix/Directory/ByteString.hsc
index cea5a5a..4ac043a 100644
--- a/System/Posix/Directory/ByteString.hsc
+++ b/System/Posix/Directory/ByteString.hsc
@@ -1,4 +1,4 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE NondecreasingIndentation #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/Directory/Common.hsc b/System/Posix/Directory/Common.hsc
index 45abbd4..29a5a59 100644
--- a/System/Posix/Directory/Common.hsc
+++ b/System/Posix/Directory/Common.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/DynamicLinker/Module.hsc b/System/Posix/DynamicLinker/Module.hsc
index f54a7c6..aa83b6b 100644
--- a/System/Posix/DynamicLinker/Module.hsc
+++ b/System/Posix/DynamicLinker/Module.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/DynamicLinker/Module/ByteString.hsc b/System/Posix/DynamicLinker/Module/ByteString.hsc
index 3921d85..dc0832a 100644
--- a/System/Posix/DynamicLinker/Module/ByteString.hsc
+++ b/System/Posix/DynamicLinker/Module/ByteString.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/DynamicLinker/Prim.hsc b/System/Posix/DynamicLinker/Prim.hsc
index ec933fb..a111e3a 100644
--- a/System/Posix/DynamicLinker/Prim.hsc
+++ b/System/Posix/DynamicLinker/Prim.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Env.hsc b/System/Posix/Env.hsc
index f7878b8..c53929f 100644
--- a/System/Posix/Env.hsc
+++ b/System/Posix/Env.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Env/ByteString.hsc b/System/Posix/Env/ByteString.hsc
index 7fdb710..1346a77 100644
--- a/System/Posix/Env/ByteString.hsc
+++ b/System/Posix/Env/ByteString.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Error.hs b/System/Posix/Error.hs
index ca66fa9..0a25777 100644
--- a/System/Posix/Error.hs
+++ b/System/Posix/Error.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc
index d9b12ad..6709e3b 100644
--- a/System/Posix/Files.hsc
+++ b/System/Posix/Files.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/Files/Common.hsc b/System/Posix/Files/Common.hsc
index 85dcd1d..f296336 100644
--- a/System/Posix/Files/Common.hsc
+++ b/System/Posix/Files/Common.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/IO.hsc b/System/Posix/IO.hsc
index ba0e690..6bea369 100644
--- a/System/Posix/IO.hsc
+++ b/System/Posix/IO.hsc
@@ -1,6 +1,4 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-{-# OPTIONS_GHC -XRecordWildCards #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/IO/ByteString.hsc b/System/Posix/IO/ByteString.hsc
index da8e65b..bf6e6bf 100644
--- a/System/Posix/IO/ByteString.hsc
+++ b/System/Posix/IO/ByteString.hsc
@@ -1,6 +1,4 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-{-# OPTIONS_GHC -XRecordWildCards #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/IO/Common.hsc b/System/Posix/IO/Common.hsc
index 366ccf8..784f1a1 100644
--- a/System/Posix/IO/Common.hsc
+++ b/System/Posix/IO/Common.hsc
@@ -1,6 +1,5 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE NondecreasingIndentation, RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-{-# OPTIONS_GHC -XRecordWildCards #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Process.hsc b/System/Posix/Process.hsc
index 4651e65..992fd9a 100644
--- a/System/Posix/Process.hsc
+++ b/System/Posix/Process.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Process/ByteString.hsc b/System/Posix/Process/ByteString.hsc
index 2be1fcd..30f40cd 100644
--- a/System/Posix/Process/ByteString.hsc
+++ b/System/Posix/Process/ByteString.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Process/Common.hsc b/System/Posix/Process/Common.hsc
index e42978b..3bcc505 100644
--- a/System/Posix/Process/Common.hsc
+++ b/System/Posix/Process/Common.hsc
@@ -1,4 +1,4 @@
-{-# LANGUAGE ForeignFunctionInterface, InterruptibleFFI #-}
+{-# LANGUAGE InterruptibleFFI #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Process/Internals.hs b/System/Posix/Process/Internals.hs
index b5017c5..8e4f451 100644
--- a/System/Posix/Process/Internals.hs
+++ b/System/Posix/Process/Internals.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Resource.hsc b/System/Posix/Resource.hsc
index 6beab78..fa4d3b3 100644
--- a/System/Posix/Resource.hsc
+++ b/System/Posix/Resource.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -w #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/Semaphore.hsc b/System/Posix/Semaphore.hsc
index 503abad..cef2f36 100644
--- a/System/Posix/Semaphore.hsc
+++ b/System/Posix/Semaphore.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/SharedMem.hsc b/System/Posix/SharedMem.hsc
index ee62839..8884a3f 100644
--- a/System/Posix/SharedMem.hsc
+++ b/System/Posix/SharedMem.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/Signals.hsc b/System/Posix/Signals.hsc
index 837050b..16761b9 100644
--- a/System/Posix/Signals.hsc
+++ b/System/Posix/Signals.hsc
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, PatternGuards, CApiFFI #-}
+{-# LANGUAGE CApiFFI, CPP, DeriveDataTypeable, NondecreasingIndentation #-}
{-# OPTIONS_GHC -fno-cse #-} -- global variables
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/Signals/Exts.hsc b/System/Posix/Signals/Exts.hsc
index cb62cb5..f539245 100644
--- a/System/Posix/Signals/Exts.hsc
+++ b/System/Posix/Signals/Exts.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Temp.hsc b/System/Posix/Temp.hsc
index 5b5cbcc..c27645f 100644
--- a/System/Posix/Temp.hsc
+++ b/System/Posix/Temp.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Temp/ByteString.hsc b/System/Posix/Temp/ByteString.hsc
index 61ab4c0..7323012 100644
--- a/System/Posix/Temp/ByteString.hsc
+++ b/System/Posix/Temp/ByteString.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Terminal.hsc b/System/Posix/Terminal.hsc
index b5519c6..6c41bdc 100644
--- a/System/Posix/Terminal.hsc
+++ b/System/Posix/Terminal.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/Terminal/ByteString.hsc b/System/Posix/Terminal/ByteString.hsc
index 34558fb..a667c8a 100644
--- a/System/Posix/Terminal/ByteString.hsc
+++ b/System/Posix/Terminal/ByteString.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/Terminal/Common.hsc b/System/Posix/Terminal/Common.hsc
index 5d718a8..2a07e28 100644
--- a/System/Posix/Terminal/Common.hsc
+++ b/System/Posix/Terminal/Common.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/Time.hsc b/System/Posix/Time.hsc
index a4903fa..4ebc8ac 100644
--- a/System/Posix/Time.hsc
+++ b/System/Posix/Time.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
diff --git a/System/Posix/Unistd.hsc b/System/Posix/Unistd.hsc
index 87974ff..266b250 100644
--- a/System/Posix/Unistd.hsc
+++ b/System/Posix/Unistd.hsc
@@ -1,4 +1,4 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE NondecreasingIndentation #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-binds #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
diff --git a/System/Posix/User.hsc b/System/Posix/User.hsc
index 30c5c71..ff7268f 100644
--- a/System/Posix/User.hsc
+++ b/System/Posix/User.hsc
@@ -1,4 +1,3 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
@@ -51,9 +50,11 @@ module System.Posix.User (
#include "HsUnix.h"
import System.Posix.Types
-import Foreign
import System.IO.Unsafe (unsafePerformIO)
import Foreign.C
+import Foreign.Ptr
+import Foreign.Marshal
+import Foreign.Storable
import System.Posix.Internals ( CGroup, CPasswd )
#if !defined(HAVE_GETPWNAM_R) || !defined(HAVE_GETPWUID_R) || defined(HAVE_GETPWENT) || defined(HAVE_GETGRENT)