Skip to content

Commit

Permalink
win32: add compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistuke committed Jan 13, 2024
1 parent c8b86bf commit 350ebd4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions System/Win32/NamedPipes.hsc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <fcntl.h>
#include <windows.h>

#include "namedpipeapi_compat.h"

{-# LANGUAGE CPP #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE MultiWayIf #-}
Expand Down
2 changes: 1 addition & 1 deletion Win32.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions include/namedpipeapi_compat.h
Original file line number Diff line number Diff line change
@@ -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 */

0 comments on commit 350ebd4

Please sign in to comment.