From 4c7c46b6af84efab1848ae21896ad7264aba6d79 Mon Sep 17 00:00:00 2001 From: usa Date: Sat, 18 Jul 2009 02:40:31 +0000 Subject: [PATCH] * random.c: workaround for VC++ 6.0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ random.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 246514f080..7688125f7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Jul 18 11:39:49 2009 NAKAMURA Usaku + + * random.c: workaround for VC++ 6.0. + Sat Jul 18 09:16:18 2009 Nobuyoshi Nakada * random.c (rb_random_{int32,real,bytes,int}): added functions for diff --git a/random.c b/random.c index ceec247fa1..e128c61e5f 100644 --- a/random.c +++ b/random.c @@ -381,6 +381,11 @@ random_init(int argc, VALUE *argv, VALUE obj) # define USE_DEV_URANDOM 0 #endif #ifdef _WIN32 +# if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0400 +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x400 +# undef __WINCRYPT_H__ +# endif #include #endif @@ -393,7 +398,7 @@ fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT]) int fd; struct stat statbuf; #elif defined(_WIN32) - HCRYPTPROV prov; + HCRYPTPROV prov; #endif memset(seed, 0, DEFAULT_SEED_LEN);