aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/WindowsEnv/Registry.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-05-26 03:45:39 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-05-26 03:45:39 +0300
commit202e1a58d5228e4efd6bafbe7b755d7bd192f516 (patch)
treed23d9b3d219eecdf48ee8f81415043e6fd5232ed /src/WindowsEnv/Registry.hs
parentrename directories (diff)
downloadwindows-env-202e1a58d5228e4efd6bafbe7b755d7bd192f516.tar.gz
windows-env-202e1a58d5228e4efd6bafbe7b755d7bd192f516.zip
fix x86 builds
Diffstat (limited to '')
-rw-r--r--src/WindowsEnv/Registry.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/WindowsEnv/Registry.hs b/src/WindowsEnv/Registry.hs
index da889d4..6eb52ca 100644
--- a/src/WindowsEnv/Registry.hs
+++ b/src/WindowsEnv/Registry.hs
@@ -8,6 +8,8 @@
--
-- Lower-level functions for reading and writing registry values.
+{-# LANGUAGE CPP #-}
+
module WindowsEnv.Registry
( IsKeyPath(..)
, RootKey(..)
@@ -148,13 +150,15 @@ decodeString (_, bytes) = T.unpack dropLastZero
| otherwise = T.takeWhile (/= '\0') text
text = decodeUtf16LE bytes
-foreign import ccall unsafe "Windows.h RegQueryValueExW"
+#include "ccall.h"
+
+foreign import WINDOWS_ENV_CCALL unsafe "Windows.h RegQueryValueExW"
c_RegQueryValueEx :: WinAPI.PKEY -> WinAPI.LPCTSTR -> WinAPI.LPDWORD -> WinAPI.LPDWORD -> WinAPI.LPBYTE -> WinAPI.LPDWORD -> IO WinAPI.ErrCode
-foreign import ccall unsafe "Windows.h RegSetValueExW"
+foreign import WINDOWS_ENV_CCALL unsafe "Windows.h RegSetValueExW"
c_RegSetValueEx :: WinAPI.PKEY -> WinAPI.LPCTSTR -> WinAPI.DWORD -> WinAPI.DWORD -> WinAPI.LPBYTE -> WinAPI.DWORD -> IO WinAPI.ErrCode
-foreign import ccall unsafe "Windows.h RegGetValueW"
+foreign import WINDOWS_ENV_CCALL unsafe "Windows.h RegGetValueW"
c_RegGetValue :: WinAPI.PKEY -> WinAPI.LPCTSTR -> WinAPI.LPCTSTR -> WinAPI.DWORD -> WinAPI.LPDWORD -> WinAPI.LPBYTE -> WinAPI.LPDWORD -> IO WinAPI.ErrCode
queryValue :: IsKeyPath a => a -> ValueName -> ExceptT IOError IO ValueData