GHC 9.4+ can no longer compile commented-out #include on Windows
GHC 9.4 and later fail to compile to entropy-0.4.1.7
because it contains the following comment:
{- C example for windows rng - taken from a blog, can't recall which one but thank you!
#include <Windows.h>
#include <Wincrypt.h>
...
//
// DISCLAIMER: Don't forget to check your error codes!!
// I am not checking as to make the example simple...
//
HCRYPTPROV hCryptCtx = NULL;
BYTE randomArray[128];
CryptAcquireContext(&hCryptCtx, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
CryptGenRandom(hCryptCtx, 128, randomArray);
CryptReleaseContext(hCryptCtx, 0);
-}
Here is a minimal example of the issue:
{-# LANGUAGE CPP #-}
module Main (main) where
{-
#include <Windows.h>
-}
main :: IO ()
main = pure ()
On GHC 9.2.3 and earlier, this compiles without issue. On GHC 9.4+, however, this fails with the following error:
$ ../../../Software/ghc-9.5.20220527/bin/ghc Main.hs -fforce-recomp
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:9:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\_mingw.h:276:2: error:
error: Only Win32 target is supported!
|
276 | #error Only Win32 target is supported!
| ^
#error Only Win32 target is supported!
^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:9:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\_mingw.h:287:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\mingw\lib\clang\13.0.0\include\vadefs.h:12:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\vadefs.h:35:2: error:
error: VARARGS not implemented for this compiler
|
35 | #error VARARGS not implemented for this compiler
| ^
#error VARARGS not implemented for this compiler
^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:10:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:213:13: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
213 | #if ((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (_WIN32_WINNT != _WIN32_WINNT_WIN2K)) || \
| ^
#if ((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (_WIN32_WINNT != _WIN32_WINNT_WIN2K)) || \
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:156:26: error:
note: expanded from macro 'OSVER'
|
156 | #define OSVER(Version) ((Version) & OSVERSION_MASK)
| ^
#define OSVER(Version) ((Version) & OSVERSION_MASK)
^~~~~~~
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:69:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\windef.h:9:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\minwindef.h:163:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winnt.h:137:2: error:
error: No supported target architecture.
|
137 | #error No supported target architecture.
| ^
#error No supported target architecture.
^
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winnt.h:4059:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
4059 | #if NTDDI_VERSION >= 0x06000000
| ^
#if NTDDI_VERSION >= 0x06000000
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:69:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\windef.h:9:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\minwindef.h:163:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winnt.h:4085:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
4085 | #if NTDDI_VERSION >= 0x06000000
| ^
#if NTDDI_VERSION >= 0x06000000
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:69:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\windef.h:9:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\minwindef.h:163:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winnt.h:5189:6: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
5189 | #if (NTDDI_VERSION >= NTDDI_WIN7)
| ^
#if (NTDDI_VERSION >= NTDDI_WIN7)
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:13:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\minwinbase.h:110:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
110 | #if NTDDI_VERSION >= 0x0A000005
| ^
#if NTDDI_VERSION >= 0x0A000005
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:13:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\minwinbase.h:123:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
123 | #if NTDDI_VERSION >= 0x0A000004
| ^
#if NTDDI_VERSION >= 0x0A000004
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:22:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\interlockedapi.h:24:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
24 | #if NTDDI_VERSION >= 0x06020000
| ^
#if NTDDI_VERSION >= 0x06020000
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:24:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\libloaderapi.h:72:6: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
72 | #if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
| ^
#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:24:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\libloaderapi.h:79:6: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
79 | #if (NTDDI_VERSION >= NTDDI_WIN10_RS2)
| ^
#if (NTDDI_VERSION >= NTDDI_WIN10_RS2)
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:25:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\memoryapi.h:61:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
61 | #if NTDDI_VERSION >= NTDDI_WIN10_RS4
| ^
#if NTDDI_VERSION >= NTDDI_WIN10_RS4
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:25:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\memoryapi.h:128:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
128 | #if NTDDI_VERSION >= NTDDI_WIN10_RS1
| ^
#if NTDDI_VERSION >= NTDDI_WIN10_RS1
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:25:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\memoryapi.h:156:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
156 | #if NTDDI_VERSION >= NTDDI_WIN10_RS2
| ^
#if NTDDI_VERSION >= NTDDI_WIN10_RS2
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:25:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\memoryapi.h:161:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
161 | #if NTDDI_VERSION >= NTDDI_WIN10_RS4
| ^
#if NTDDI_VERSION >= NTDDI_WIN10_RS4
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:25:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\memoryapi.h:166:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
166 | #if NTDDI_VERSION >= NTDDI_WIN10_RS5
| ^
#if NTDDI_VERSION >= NTDDI_WIN10_RS5
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:29:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\processthreadsapi.h:297:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
297 | #if NTDDI_VERSION >= NTDDI_WIN10_VB
| ^
#if NTDDI_VERSION >= NTDDI_WIN10_VB
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
In file included from Main.hs:5:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\Windows.h:70:0: error:
In file included from C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\winbase.h:29:0: error:
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\processthreadsapi.h:300:5: error:
error: token is not a valid binary operator in a preprocessor subexpression
|
300 | #if NTDDI_VERSION >= NTDDI_WIN10_MN
| ^
#if NTDDI_VERSION >= NTDDI_WIN10_MN
^~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:172:23: error:
note: expanded from macro 'NTDDI_VERSION'
|
172 | #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
| ^
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
^ ~~~~~~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:162:49: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT'
|
162 | #define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT(Version) NTDDI_VERSION_FROM_WIN32_WINNT2(Version)
^ ~~~~~~~
C:\Users\winferno\Software\ghc-9.5.20220527\lib\..\mingw\x86_64-w64-mingw32\include\sdkddkver.h:161:57: error:
note: expanded from macro 'NTDDI_VERSION_FROM_WIN32_WINNT2'
|
161 | #define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
| ^
#define NTDDI_VERSION_FROM_WIN32_WINNT2(Version) Version##0000
~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Main.hs:1:1: error:
`clang.exe' failed in phase `C pre-processor'. (Exit code: 1)
|
1 | {-# LANGUAGE CPP #-}
| ^
Should this be expected to work? I imagine the switch from gcc
to clang
has something to do with this, although I'm not sure if this constitutes a bug or expected behavior from clang
's CPP preprocessor.