sniper Sun Jan 18 21:30:55 2004 EDT Modified files: /php-src/ext/standard php_rand.h Log: - Fixed bug #26949 (rand(min,max) always returns min when ZTS enabled) Index: php-src/ext/standard/php_rand.h diff -u php-src/ext/standard/php_rand.h:1.26 php-src/ext/standard/php_rand.h:1.27 --- php-src/ext/standard/php_rand.h:1.26 Thu Jan 8 12:32:51 2004 +++ php-src/ext/standard/php_rand.h Sun Jan 18 21:30:54 2004 @@ -20,7 +20,7 @@ | Based on code from: Shawn Cokus <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_rand.h,v 1.26 2004/01/08 17:32:51 sniper Exp $ */ +/* $Id: php_rand.h,v 1.27 2004/01/19 02:30:54 sniper Exp $ */ #ifndef PHP_RAND_H #define PHP_RAND_H @@ -33,7 +33,8 @@ #define RAND_MAX (1<<15) #endif -#if defined(HAVE_LRAND48) || defined(HAVE_RANDOM) +/* In ZTS mode we rely on rand_r() so we must use RAND_MAX. */ +#if !defined(ZTS) && (defined(HAVE_LRAND48) || defined(HAVE_RANDOM)) #define PHP_RAND_MAX 2147483647 #else #define PHP_RAND_MAX RAND_MAX
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php