diff --git a/System/Win32/NamedPipes.hsc b/System/Win32/NamedPipes.hsc index a644491..2fe02cf 100644 --- a/System/Win32/NamedPipes.hsc +++ b/System/Win32/NamedPipes.hsc @@ -1,6 +1,8 @@ #include #include +#include "namedpipeapi_compat.h" + {-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE MultiWayIf #-} diff --git a/Win32.cabal b/Win32.cabal index cd84a52..8488b7a 100644 --- a/Win32.cabal +++ b/Win32.cabal @@ -155,7 +155,7 @@ Library ghc-options: -Wall include-dirs: include includes: "alphablend.h", "diatemp.h", "dumpBMP.h", "ellipse.h", "errors.h", "HsGDI.h", "HsWin32.h", "Win32Aux.h", "win32debug.h", "windows_cconv.h", "WndProc.h", "alignment.h" - install-includes: "HsWin32.h", "HsGDI.h", "WndProc.h", "windows_cconv.h", "alphablend.h", "wincon_compat.h", "winternl_compat.h", "winuser_compat.h", "winreg_compat.h", "tlhelp32_compat.h", "winnls_compat.h", "winnt_compat.h" + install-includes: "HsWin32.h", "HsGDI.h", "WndProc.h", "windows_cconv.h", "alphablend.h", "wincon_compat.h", "winternl_compat.h", "winuser_compat.h", "winreg_compat.h", "tlhelp32_compat.h", "winnls_compat.h", "winnt_compat.h", "namedpipeapi_compat.h" c-sources: cbits/HsGDI.c cbits/HsWin32.c diff --git a/include/namedpipeapi_compat.h b/include/namedpipeapi_compat.h new file mode 100644 index 0000000..f16d10a --- /dev/null +++ b/include/namedpipeapi_compat.h @@ -0,0 +1,16 @@ +/* The version of wincon.h provided by the version of MSYS2 included with x86 + * versions of GHC before GHC 7.10 excludes certain components introduced with + * Windows Vista. + */ + +#ifndef NAMEDPIPEAPI_COMPAT_H +#define NAMEDPIPEAPI_COMPAT_H + +#if defined(x86_64_HOST_ARCH) || __GLASGOW_HASKELL__ > 708 +# +#else + +#define PIPE_ACCEPT_REMOTE_CLIENTS 0x0 +#define PIPE_REJECT_REMOTE_CLIENTS 0x8 +#endif /* GHC version check */ +#endif /* NAMEDPIPEAPI_COMPAT_H */