diff --git a/ChangeLog b/ChangeLog index 6950b4049b..49cd055d6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Mar 29 09:16:45 2010 NARUSE, Yui + + * random.c: change include order; ruby.h should be at first. + Mon Mar 29 06:47:25 2010 Aaron Patterson * ext/psych/*: importing Psych to trunk diff --git a/random.c b/random.c index f09e1a95fe..9e35861fad 100644 --- a/random.c +++ b/random.c @@ -59,7 +59,30 @@ The original copyright notice follows. email: matumoto@math.keio.ac.jp */ +#include "ruby/ruby.h" + #include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#include +#ifdef HAVE_FCNTL_H +#include +#endif +#include +#include + +#ifdef _WIN32 +# if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0400 +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x400 +# undef __WINCRYPT_H__ +# endif +#include +#endif + typedef int int_must_be_32bit_at_least[sizeof(int) * CHAR_BIT < 32 ? -1 : 1]; /* Period parameters */ @@ -194,20 +217,6 @@ genrand_real2(struct MT *mt) /* These real versions are due to Isaku Wada, 2002/01/09 added */ -#include "ruby/ruby.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#ifdef HAVE_FCNTL_H -#include -#endif -#include -#include - typedef struct { VALUE seed; struct MT mt; @@ -449,14 +458,6 @@ random_init(int argc, VALUE *argv, VALUE obj) #else # 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 static void fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT])