cvs: php4 /ext/standard rand.c

From: Date: Sun, 16 Sep 2001 17:37:19 +0000
Subject: cvs: php4 /ext/standard rand.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7433@lists.php.net to get a copy of this message
sterling Sun Sep 16 13:37:19 2001 EDT Modified files: /php4/ext/standard rand.c Log: Hopefully fix compile warnings on win32 systems Index: php4/ext/standard/rand.c diff -u php4/ext/standard/rand.c:1.52 php4/ext/standard/rand.c:1.53 --- php4/ext/standard/rand.c:1.52 Sat Sep 15 23:50:04 2001 +++ php4/ext/standard/rand.c Sun Sep 16 13:37:19 2001 @@ -20,13 +20,18 @@ | Based on code from: Shawn Cokus <Cokus@math.washington.edu> | +----------------------------------------------------------------------+ */ -/* $Id: rand.c,v 1.52 2001/09/16 03:50:04 sterling Exp $ */ +/* $Id: rand.c,v 1.53 2001/09/16 17:37:19 sterling Exp $ */ #include <stdlib.h> +#ifdef PHP_WIN32 +#include <windows.h> +#endif + #include "php.h" #include "php_math.h" #include "php_rand.h" +#include "php_lcg.h" #include "basic_functions.h" @@ -192,7 +197,11 @@ return y ^ (y >> 18); } +#ifdef PHP_WIN32 +#define GENERATE_SEED() (time(0) * GetCurrentProcessId() * 1000000 * php_combined_lcg(TSRMLS_C)) +#else #define GENERATE_SEED() (time(0) * getpid() * 1000000 * php_combined_lcg(TSRMLS_C)) +#endif /* {{{ proto void srand([int seed]) Seeds random number generator */

« previous php.cvs (#7433) next »