git.iko.soy/typeable/entropy
on main help sign in
Merge pull request #67 from RyanGlScott/windows-clang-fix

Fix the build with Clang on Windows

commit547e76882b780ab591cd8c9008598960aaf2663a authorThomas M. DuBuisson <thomas.dubuisson@gmail.com> dateSun 14 Aug 2022, 17:53 (4 years ago) parent0916ac5dcdaa91
1 file changed+14−15
System/EntropyWindows.hs+14−15
System/EntropyWindows.hs+14−15
@@ -31,21 +31,20 @@ import Foreign.Marshal.Alloc (alloca)
3131import Foreign.Marshal.Utils (toBool)
3232import Foreign.Storable (peek)
3333
34−{- C example for windows rng - taken from a blog, can't recall which one but thank you!
35− #include <Windows.h>
36− #include <Wincrypt.h>
37− ...
38− //
39− // DISCLAIMER: Don't forget to check your error codes!!
40− // I am not checking as to make the example simple...
41− //
42− HCRYPTPROV hCryptCtx = NULL;
43− BYTE randomArray[128];
44−
45− CryptAcquireContext(&hCryptCtx, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
46− CryptGenRandom(hCryptCtx, 128, randomArray);
47− CryptReleaseContext(hCryptCtx, 0);
48−-}
34+-- C example for windows rng - taken from a blog, can't recall which one but thank you!
35+-- #include <Windows.h>
36+-- #include <Wincrypt.h>
37+-- ...
38+-- //
39+-- // DISCLAIMER: Don't forget to check your error codes!!
40+-- // I am not checking as to make the example simple...
41+-- //
42+-- HCRYPTPROV hCryptCtx = NULL;
43+-- BYTE randomArray[128];
44+--
45+-- CryptAcquireContext(&hCryptCtx, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
46+-- CryptGenRandom(hCryptCtx, 128, randomArray);
47+-- CryptReleaseContext(hCryptCtx, 0);
4948
5049
5150#ifdef arch_i386