From 8fa91a91aba13be2a364569db5ac721a5490f575 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 14 Oct 2013 13:40:54 -0700 Subject: [PATCH] Cast CryptGenRandom pointer to (BYTE *) to make MSVC happy when compiling as a C++ project --- src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c | 2 +- src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c b/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c index 4d355a3e..71a69fc1 100644 --- a/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +++ b/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c @@ -178,7 +178,7 @@ randombytes_salsa20_random_stir(void) abort(); } #else /* _WIN32 */ - if (! CryptGenRandom(stream.hcrypt_prov, sizeof m0, m0)) { + if (! CryptGenRandom(stream.hcrypt_prov, sizeof m0, (BYTE *) m0)) { abort(); } #endif diff --git a/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c b/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c index c82cb563..b8ecd72e 100644 --- a/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +++ b/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c @@ -167,7 +167,7 @@ randombytes_sysrandom_buf(void * const buf, const size_t size) abort(); } #else - if (! CryptGenRandom(stream.hcrypt_prov, size, buf)) { + if (! CryptGenRandom(stream.hcrypt_prov, size, (BYTE *) buf)) { abort(); } #endif