summaryrefslogtreecommitdiffstats
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-18 00:10:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-18 00:10:46 +0000
commit2c2963d3e8ab4c50b7dea9f0f1c73c40a54d5e94 (patch)
tree39756d99a65ba6bfd648e942a72e448740e19a03 /random.c
parent9b63cf3ea0a6cbcaac79cab2c5c5cbdd97a3d84b (diff)
downloadruby-2c2963d3e8ab4c50b7dea9f0f1c73c40a54d5e94.tar.gz
ruby-2c2963d3e8ab4c50b7dea9f0f1c73c40a54d5e94.tar.xz
ruby-2c2963d3e8ab4c50b7dea9f0f1c73c40a54d5e94.zip
* random.c (fill_random_seed): needs wincrypt.h.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/random.c b/random.c
index 8013a51d0..57ab67383 100644
--- a/random.c
+++ b/random.c
@@ -380,6 +380,9 @@ random_init(int argc, VALUE *argv, VALUE obj)
#else
# define USE_DEV_URANDOM 0
#endif
+#ifdef _WIN32
+#include <wincrypt.h>
+#endif
static void
fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT])
@@ -414,7 +417,7 @@ fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT])
}
#elif defined(_WIN32)
if (CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
- CryptGenRandom(prov, DEFAULT_SEED_LEN, seed);
+ CryptGenRandom(prov, DEFAULT_SEED_LEN, (void *)seed);
CryptReleaseContext(prov, 0);
}
#endif