Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
8a3877ae
Commit
8a3877ae
authored
Nov 10, 2009
by
Duncan Coutts
Browse files
Fix base 4 exceptions in #ifdef WIN32 code section
parent
c6c1d6ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/HttpUtils.hs
View file @
8a3877ae
...
...
@@ -24,7 +24,9 @@ import System.Win32.Registry
(
hKEY_CURRENT_USER
,
regOpenKey
,
regCloseKey
,
regQueryValue
,
regQueryValueEx
)
import
Control.Exception
(
handle
,
bracket
)
(
bracket
)
import
Distribution.Compat.Exception
(
handleIO
)
import
Foreign
(
toBool
,
Storable
(
peek
,
sizeOf
),
castPtr
,
alloca
)
#
endif
...
...
@@ -46,7 +48,7 @@ import qualified System.FilePath.Posix as FilePath.Posix
proxyString
,
envProxyString
,
registryProxyString
::
IO
(
Maybe
String
)
#
ifdef
WIN32
-- read proxy settings from the windows registry
registryProxyString
=
handle
(
\
_
->
return
Nothing
)
$
registryProxyString
=
handle
IO
(
\
_
->
return
Nothing
)
$
bracket
(
regOpenKey
hive
path
)
regCloseKey
$
\
hkey
->
do
enable
<-
fmap
toBool
$
regQueryValueDWORD
hkey
"ProxyEnable"
if
enable
...
...
cabal-install/Distribution/Compat/Exception.hs
View file @
8a3877ae
...
...
@@ -7,6 +7,7 @@ module Distribution.Compat.Exception (
SomeException
,
onException
,
catchIO
,
handleIO
,
catchExit
,
throwIOIO
)
where
...
...
@@ -42,6 +43,9 @@ catchIO = Exception.catch
catchIO
=
Exception
.
catchJust
Exception
.
ioErrors
#
endif
handleIO
::
(
Exception
.
IOException
->
IO
a
)
->
IO
a
->
IO
a
handleIO
=
flip
catchIO
catchExit
::
IO
a
->
(
ExitCode
->
IO
a
)
->
IO
a
#
if
MIN_VERSION_base
(
4
,
0
,
0
)
catchExit
=
Exception
.
catch
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment