From 43de23c79db9e6e9a6de984b964cc9bdf74e50c2 Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel Date: Sat, 12 Oct 2013 13:01:50 +0200 Subject: 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 --- System/Posix.hs | 1 + System/Posix/ByteString.hs | 1 + System/Posix/Directory.hsc | 2 +- System/Posix/Directory/ByteString.hsc | 2 +- System/Posix/Directory/Common.hsc | 1 - System/Posix/DynamicLinker/Module.hsc | 1 - System/Posix/DynamicLinker/Module/ByteString.hsc | 1 - System/Posix/DynamicLinker/Prim.hsc | 1 - System/Posix/Env.hsc | 1 - System/Posix/Env/ByteString.hsc | 1 - System/Posix/Error.hs | 1 + System/Posix/Files.hsc | 1 - System/Posix/Files/Common.hsc | 1 - System/Posix/IO.hsc | 2 -- System/Posix/IO/ByteString.hsc | 2 -- System/Posix/IO/Common.hsc | 3 +-- System/Posix/Process.hsc | 1 - System/Posix/Process/ByteString.hsc | 1 - System/Posix/Process/Common.hsc | 2 +- System/Posix/Process/Internals.hs | 1 + System/Posix/Resource.hsc | 1 - System/Posix/Semaphore.hsc | 1 - System/Posix/SharedMem.hsc | 1 - System/Posix/Signals.hsc | 2 +- System/Posix/Signals/Exts.hsc | 1 - System/Posix/Temp.hsc | 1 - System/Posix/Temp/ByteString.hsc | 1 - System/Posix/Terminal.hsc | 1 - System/Posix/Terminal/ByteString.hsc | 1 - System/Posix/Terminal/Common.hsc | 1 - System/Posix/Time.hsc | 1 - System/Posix/Unistd.hsc | 2 +- System/Posix/User.hsc | 5 +++-- 33 files changed, 13 insertions(+), 33 deletions(-) (limited to 'System') 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) -- cgit v1.2.3